When running the module code against Drupal coding standards based on Drupal standard, the module shows errors

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme modules/contrib/token/

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

vinod_kc created an issue. See original summary.

vinod_kc’s picture

As there are lot of coding standard issues, fix can be done in separate patches. Adding my first patch.

hussainweb’s picture

Status: Active » Needs work
  1. +++ b/src/Plugin/Derivative/DevelLocalTask.php
    @@ -9,12 +9,23 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
    + * Foe devel local tasks.
    

    Typo

  2. +++ b/src/Token.php
    @@ -88,8 +88,9 @@ class Token extends TokenBase implements TokenInterface {
    +        // then it is a global token type that will always be replaced
    +        // in any context.
    

    "in any" can go on the previous line.

  3. +++ b/src/TreeBuilder.php
    @@ -7,6 +7,9 @@ use Drupal\Core\Cache\CacheBackendInterface;
    + * Defines the tree bilder handler class for tokens.
    

    Typo.

  4. +++ b/tests/modules/token_module_test/token_module_test.module
    @@ -20,7 +25,9 @@ function token_module_test_page_attachments() {
    + * For node entities.
    

    The description isn't really useful.

  5. +++ b/tests/modules/token_module_test/token_module_test.tokens.inc
    @@ -1,7 +1,12 @@
    + * @file
    

    This is no longer encouraged. Core has removed @file everywhere.

  6. +++ b/token.module
    @@ -714,8 +731,8 @@ function token_node_menu_link_submit($entity_type, NodeInterface $node, &$form,
    +            // important for token generation.
    

    "important" can go above.

rajeshwari10’s picture

Assigned: Unassigned » rajeshwari10
rajeshwari10’s picture

Assigned: rajeshwari10 » Unassigned
cmsMinds’s picture

Assigned: Unassigned » cmsMinds
FileSize
92.43 KB

Please do check coding standards issues.

Yago Elias’s picture

HI! I couldn't apply patch #2 .

used : phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md'

and then passed phpcbf.

Here is what i have until now.