Fix the issues reported by PHPCS

Created on 16 May 2024, about 1 month ago
Updated 19 May 2024, about 1 month ago

FILE: /home/addweb/Drupal8-vagrant/web/web/entityform_block/tests/src/Functional/EntityFormBlockTest.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 5 WARNINGS AFFECTING 12 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Short array syntax must be used to define arrays
30 | WARNING | [x] A comma should follow the last multiline array item. Found: 'contact'
38 | ERROR | [x] Short array syntax must be used to define arrays
40 | ERROR | [x] Short array syntax must be used to define arrays
59 | ERROR | [x] Short array syntax must be used to define arrays
62 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
73 | ERROR | [x] Short array syntax must be used to define arrays
78 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
83 | ERROR | [x] Short array syntax must be used to define arrays
86 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
96 | ERROR | [x] Short array syntax must be used to define arrays
99 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/addweb/Drupal8-vagrant/web/web/entityform_block/tests/src/Functional/LocaleTest.php
-----------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------
15 | ERROR | [ ] Missing member variable doc comment
27 | ERROR | [x] Expected 1 space after "="; 2 found
29 | ERROR | [x] Short array syntax must be used to define arrays
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

FILE: /home/addweb/Drupal8-vagrant/web/web/entityform_block/src/Plugin/Block/EntityEditFormBlock.php
----------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
----------------------------------------------------------------------------------------------------
76 | ERROR | [x] Short array syntax must be used to define arrays
105 | ERROR | [x] Short array syntax must be used to define arrays
123 | ERROR | [x] Short array syntax must be used to define arrays
148 | ERROR | [x] Short array syntax must be used to define arrays
152 | ERROR | [x] Short array syntax must be used to define arrays
160 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
166 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
167 | ERROR | [x] Expected 1 blank line after function; 0 found
168 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------

šŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India dev16.addweb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dev16.addweb
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied the patch and I confirmed that it fixes the PHPCS issues.

    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml entityform_block
    
    FILE: ...ules/contrib/entityform_block/tests/src/Functional/EntityFormBlockTest.php
    --------------------------------------------------------------------------------
    FOUND 8 ERRORS AND 5 WARNINGS AFFECTING 12 LINES
    --------------------------------------------------------------------------------
     24 | ERROR   | [x] Short array syntax must be used to define arrays
     30 | WARNING | [x] A comma should follow the last multiline array item. Found:
        |         |     'contact'
     38 | ERROR   | [x] Short array syntax must be used to define arrays
     38 | ERROR   | [ ] The array declaration extends to column 82 (the limit is
        |         |     80). The array content should be split up over multiple
        |         |     lines
     40 | ERROR   | [x] Short array syntax must be used to define arrays
     59 | ERROR   | [x] Short array syntax must be used to define arrays
     62 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     73 | ERROR   | [x] Short array syntax must be used to define arrays
     78 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     83 | ERROR   | [x] Short array syntax must be used to define arrays
     86 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
     96 | ERROR   | [x] Short array syntax must be used to define arrays
     99 | WARNING | [ ] t() calls should be avoided in classes, use
        |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
        |         |     $this->t() instead
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...l/web/modules/contrib/entityform_block/tests/src/Functional/LocaleTest.php
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
     15 | ERROR | [ ] Missing member variable doc comment
     27 | ERROR | [x] Expected 1 space after "="; 2 found
     29 | ERROR | [x] Short array syntax must be used to define arrays
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: .../modules/contrib/entityform_block/src/Plugin/Block/EntityEditFormBlock.php
    --------------------------------------------------------------------------------
    FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
    --------------------------------------------------------------------------------
      76 | ERROR   | [x] Short array syntax must be used to define arrays
     105 | ERROR   | [x] Short array syntax must be used to define arrays
     123 | ERROR   | [x] Short array syntax must be used to define arrays
     148 | ERROR   | [x] Short array syntax must be used to define arrays
     152 | ERROR   | [x] Short array syntax must be used to define arrays
     160 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
     166 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
     167 | ERROR   | [x] Expected 1 blank line after function; 0 found
     168 | ERROR   | [x] The closing brace for the class must have an empty line
         |         |     before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 125ms; Memory: 10MB
    
    āžœ  contrib git:(master) āœ— cd entityform_block 
    āžœ  entityform_block git:(8.x-1.0-alpha4) curl https://www.drupal.org/files/issues/2024-05-16/resolve_phpcs_issues.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 10024  100 10024    0     0  32212      0 --:--:-- --:--:-- --:--:-- 33082
    patching file 'src/Plugin/Block/EntityEditFormBlock.php'
    patching file 'tests/src/Functional/EntityFormBlockTest.php'
    patching file 'tests/src/Functional/LocaleTest.php'
    āžœ  entityform_block git:(8.x-1.0-alpha4) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml entityform_block
    āžœ  contrib git:(master) āœ— 
    

    RTBC +1 from me. retaining the status to needs review for others to verify the patch

Production build 0.69.0 2024