Problem/Motivation
Getting following error/warnings.
FILE: /var/www/html/modules/contrib/publishing_dropbutton/tests/src/Functional/NodeFormButtonsTest.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 16 WARNINGS AFFECTING 17 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
45 | ERROR | [x] Missing function doc comment
49 | ERROR | [ ] The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
51 | ERROR | [ ] The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
64 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
64 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
70 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
78 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
78 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
82 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
90 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
97 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
97 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
105 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
110 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
119 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
129 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
146 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
146 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
153 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
186 | ERROR | [x] Expected 1 blank line after function; 2 found
189 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/publishing_dropbutton/tests/src/Functional/ModerationFormTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
------------------------------------------------------------------------------------------------------------------------------------------
59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
100 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
136 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
157 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
166 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
175 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
190 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
208 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
227 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
236 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
247 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
268 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
281 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/publishing_dropbutton/publishing_dropbutton.module
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
12 | WARNING | [x] Unused use statement
24 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/publishing_dropbutton/src/Plugin/Field/FieldWidget/ModerationStateWidget.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------
78 | ERROR | [x] Parameter comment must end with a full stop
120 | ERROR | [x] Data types in @var tags need to be fully namespaced
212 | ERROR | [ ] The array declaration extends to column 95 (the limit is 80). The array content should be split up over multiple lines
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/publishing_dropbutton/src/NodePublishingDropbutton.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 9 WARNINGS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------------------------
24 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
25 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
26 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
27 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
28 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
28 | WARNING | [x] There must be no blank line following an inline comment
28 | WARNING | [ ] There must be no blank line following an inline comment
28 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
32 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
45 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
Time: 1.63 secs; Memory: 6MB
Steps to reproduce
Run following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/publishing_dropbutton/
Proposed resolution
Above error/warnings need to be fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | Appliedlatestcommit.png | 79.18 KB | roberttabigue |
| #9 | AfterPatch.png | 212.6 KB | roberttabigue |
| #9 | BeforePatch.png | 725.66 KB | roberttabigue |
| #2 | 3341183-2.patch | 18.19 KB | samitk |
Issue fork publishing_dropbutton-3341183
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
samitk commentedAbove error/warnings are fixed.
Comment #3
hardikpandya commentedI have checked the patch is applying and there are no more phpcs issues reported. Marking as RTBC!
Comment #5
avpadernoSince that data is shown in a tabular format, the existing code is much more readable. Code lines are allowed to exceed 80 characters.
Comment #6
nitin_lamaComment #7
nitin_lamaPlease review.
Comment #8
nitin_lamaComment #9
roberttabigue commentedHi,
I'm still seeing PHPCS errors after applying the latest Merge to the Publishing Dropbutton module with version 8.x-1.x-dev and with Drupal core version 9.5.8.
Marking this as Needs work for now.
Kindly refer to the attached screenshots, please.
Comment #11
sakthi_dev commentedPlease review.
Comment #12
roberttabigue commentedHi @sakthi_dev,
Confirmed it resolves the PHPCS errors after applying your latest commit to the Publishing Drop Button module version 8.x-1.x-dev and with Drupal core version 9.5.8.
Marking this now as RTBC,
Thank you!
Comment #13
avpadernoComment #14
nitin_lamaComment #15
nitin_lamaComment #16
nitin_lamaComment #17
larowlanThanks folks - marking this as a duplicate of #3463893: Add gitlabci
Not transferring credit because I don't give credit for PHPCS issues for those who already have such credits, these are great first issues, but not for established contributors.