Coding standards

Created on 18 April 2023, over 1 year ago
Updated 23 August 2024, 3 months ago

vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/system_tags/

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/modules/theme/system_tags_theme.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
56 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "_system_tag_node_suggestions" but expected "system_tags_theme__system_tag_node_suggestions"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/system_tags.tokens.inc
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
61 | ERROR | [x] list(...) is forbidden, use [...] instead.
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagListBuilder.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Annotation/SystemTagFinder.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
13 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/TwigExtension/SystemTagsTwigExtension.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Config/SystemTagDefinitions.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Config/SystemPageConfigOverrider.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
15 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagHelper.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagFinder/SystemTagFinderPluginBase.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
17 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagFinder/SystemTagFinderManagerInterface.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
--------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagFinder/SystemTagFinderManager.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------
16 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
45 | WARNING | Exceptions should not be translated
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagFinder/SystemTagFinderInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Form/SystemTagForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
13 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Form/SystemTagDeleteForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Plugin/SystemTagFinder/SystemTagBlockFinder.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
16 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Plugin/SystemTagFinder/SystemTagNodeFinder.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
16 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Plugin/Condition/SystemTags.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
22 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagAccessControlHandler.php
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
28 | ERROR | [x] Whitespace found at end of line
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagHelperInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/SystemTagHtmlRouteProvider.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Entity/SystemTagInterface.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/src/Entity/SystemTag.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
45 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/tests/src/Functional/DefaultSystemTagsTest.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
15 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/system_tags/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
----------------------------------------------------------------------
44 | WARNING | Line exceeds 80 characters; contains 99 characters
46 | WARNING | Line exceeds 80 characters; contains 112 characters
52 | WARNING | Line exceeds 80 characters; contains 98 characters
53 | WARNING | Line exceeds 80 characters; contains 82 characters
54 | WARNING | Line exceeds 80 characters; contains 109 characters
59 | WARNING | Line exceeds 80 characters; contains 113 characters
60 | WARNING | Line exceeds 80 characters; contains 85 characters
65 | WARNING | Line exceeds 80 characters; contains 116 characters
66 | WARNING | Line exceeds 80 characters; contains 114 characters

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India dineshkumarbollu

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @dineshkumarbollu
  • Assigned to shailja179
  • Status changed to Needs work over 1 year ago
  • Merge request !5Resolve #3354790 "Coding standards" → (Merged) created by dineshkumarbollu
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work 4 months ago
  • Hi @dineshkomarbollu,

    The latest changes you committed on MR !5 was patched not-so successfully, few errors were still reported. Please see below:

    system_tags git:(2.0.1) curl https://git.drupalcode.org/project/system_tags/-/merge_requests/5.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 17469    0 17469    0     0  29792      0 --:--:-- --:--:-- --:--:-- 30328
    patching file README.md
    patching file modules/theme/system_tags_theme.module
    Reversed (or previously applied) patch detected!  Assume -R? [n] y
    patching file src/Annotation/SystemTagFinder.php
    patching file src/Config/SystemPageConfigOverrider.php
    patching file src/Config/SystemTagDefinitions.php
    patching file src/Entity/SystemTag.php
    patching file src/Entity/SystemTagInterface.php
    patching file src/Form/SystemTagDeleteForm.php
    patching file src/Form/SystemTagForm.php
    patching file src/Plugin/Condition/SystemTags.php
    patching file src/Plugin/SystemTagFinder/SystemTagBlockFinder.php
    patching file src/Plugin/SystemTagFinder/SystemTagNodeFinder.php
    patching file src/SystemTagAccessControlHandler.php
    patching file src/SystemTagFinder/SystemTagFinderInterface.php
    patching file src/SystemTagFinder/SystemTagFinderManager.php
    patching file src/SystemTagFinder/SystemTagFinderManagerInterface.php
    patching file src/SystemTagFinder/SystemTagFinderPluginBase.php
    Hunk #2 FAILED at 95.
    Hunk #3 FAILED at 106.
    2 out of 3 hunks FAILED -- saving rejects to file src/SystemTagFinder/SystemTagFinderPluginBase.php.rej
    patching file src/SystemTagHelper.php
    patching file src/SystemTagHelperInterface.php
    patching file src/SystemTagHtmlRouteProvider.php
    patching file src/SystemTagListBuilder.php
    patching file src/TwigExtension/SystemTagsTwigExtension.php
    Hunk #1 FAILED at 3.
    Hunk #2 FAILED at 40.
    2 out of 2 hunks FAILED -- saving rejects to file src/TwigExtension/SystemTagsTwigExtension.php.rej
    patching file system_tags.tokens.inc
    patching file tests/src/Functional/DefaultSystemTagsTest.php
    ➜  system_tags git:(2.0.1) ✗ cd ..
    ➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig system_tags
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/system_tags/tests/src/Functional/DefaultSystemTagsTest.php
    ----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\system_tags\Config\SystemTagDefinitions.
    ----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/system_tags/system_tags.module
    --------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------
     11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Access\AccessResult.
    --------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/system_tags/modules/theme/system_tags_theme.module
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      8 | ERROR | [x] Expected strict_types=1, found strict_types = 1.
     56 | ERROR | [ ] All functions defined in a module file must be prefixed with the module's name, found "_system_tag_node_suggestions" but expected
        |       |     "system_tags_theme__system_tag_node_suggestions"
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/system_tags/src/Plugin/Condition/SystemTags.php
    ---------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------
     48 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    ---------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/system_tags/src/SystemTagFinder/SystemTagFinderPluginBase.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------
     63 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    -----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/system_tags/src/TwigExtension/SystemTagsTwigExtension.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    -------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 405ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Assigned to dev2.addweb
  • 🇮🇳India dev2.addweb

    Hello,

    I have fixed all the above mentioned errors and warnings. Please check.

  • Issue was unassigned.
  • Status changed to Needs review 4 months ago
  • Status changed to Needs work 4 months ago
  • 🇵🇭Philippines paraderojether

    Hi

    I reviewed MR!5, and applied it against Systems Tags 2.0.1 and it is not applied cleanly.

    ➜  system_tags git:(2.0.1) curl https://git.drupalcode.org/project/system_tags/-/merge_requests/5.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 19046    0 19046    0     0  59017      0 --:--:-- --:--:-- --:--:-- 61637
    Checking patch README.md...
    Checking patch modules/theme/system_tags_theme.module...
    error: while searching for:
     * Implements hook_theme_suggestions_HOOK_alter().
     */
    function system_tags_theme_theme_suggestions_node_alter(array &$suggestions, array $variables) {
      $suggestions = array_merge($suggestions, _system_tag_node_suggestions('node__system_tag__', $variables['elements']['#node']));
    }
    
    /**
    
    error: patch failed: modules/theme/system_tags_theme.module:27
    error: modules/theme/system_tags_theme.module: patch does not apply
    Checking patch src/Annotation/SystemTagFinder.php...
    Checking patch src/Config/SystemPageConfigOverrider.php...
    Checking patch src/Config/SystemTagDefinitions.php...
    Checking patch src/Entity/SystemTag.php...
    Checking patch src/Entity/SystemTagInterface.php...
    Checking patch src/Form/SystemTagDeleteForm.php...
    Checking patch src/Form/SystemTagForm.php...
    Checking patch src/Plugin/Condition/SystemTags.php...
    Checking patch src/Plugin/SystemTagFinder/SystemTagBlockFinder.php...
    Checking patch src/Plugin/SystemTagFinder/SystemTagNodeFinder.php...
    Checking patch src/SystemTagAccessControlHandler.php...
    Checking patch src/SystemTagFinder/SystemTagFinderInterface.php...
    Checking patch src/SystemTagFinder/SystemTagFinderManager.php...
    Checking patch src/SystemTagFinder/SystemTagFinderManagerInterface.php...
    Checking patch src/SystemTagFinder/SystemTagFinderPluginBase.php...
    error: while searching for:
          $storage = $this->entityTypeManager->getStorage($entityTypeId);
    
          $query = $storage->getQuery()
            ->sort('changed', 'DESC', $langcode);
          $orCondition = $query->orConditionGroup();
          foreach ($fields as $field) {
    
    error: patch failed: src/SystemTagFinder/SystemTagFinderPluginBase.php:95
    error: src/SystemTagFinder/SystemTagFinderPluginBase.php: patch does not apply
    Checking patch src/SystemTagHelper.php...
    Checking patch src/SystemTagHelperInterface.php...
    Checking patch src/SystemTagHtmlRouteProvider.php...
    Checking patch src/SystemTagListBuilder.php...
    Checking patch src/TwigExtension/SystemTagsTwigExtension.php...
    error: while searching for:
    namespace Drupal\system_tags\TwigExtension;
    
    use Drupal\system_tags\SystemTagFinder\SystemTagFinderManagerInterface;
    
    /**
     * Class SystemTagsTwigExtension.
     */
    class SystemTagsTwigExtension extends \Twig_Extension {
    
      /**
       * The system tag finder manager.
    
    error: patch failed: src/TwigExtension/SystemTagsTwigExtension.php:3
    error: src/TwigExtension/SystemTagsTwigExtension.php: patch does not apply
    Checking patch system_tags.module...
    Checking patch system_tags.tokens.inc...
    Checking patch tests/src/Functional/DefaultSystemTagsTest.php...

    Kindly check and advise, please.
    Thank you.

  • First commit to issue fork.
  • 🇧🇪Belgium lammensj

    Thank you for your contribution!

  • Status changed to Fixed 3 months ago
  • Status changed to Fixed 3 months ago
Production build 0.71.5 2024