Problem/Motivation
Getting following error/warnings
FILE: /app/modules/contrib/publishcontent/publishcontent.links.task.yml
-----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------
FILE: /app/modules/contrib/publishcontent/src/Controller/PublishContentPublishEntity.php
--------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------
138 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
165 | ERROR | Public method name "PublishContentPublishEntity::hasUILocalTask" is not in lowerCamel format
--------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/publishcontent/src/Form/PublishContentSettings.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: /app/modules/contrib/publishcontent/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php
-----------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------
77 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
79 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
79 | ERROR | [x] Concat operator must be surrounded by a single space
80 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
82 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
83 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
83 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 4
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/publishcontent/src/Plugin/views/field/PublishContentNode.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------
64 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------
Time: 1.29 secs; Memory: 10MB
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/publishcontent/
Proposed resolution
Above error/warnings need to be fixed
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | after-patch.png | 145.02 KB | sourabhjain |
| #4 | before-patch.png | 1.27 MB | sourabhjain |
| #2 | 3327032-2.patch | 4.87 KB | samitk |
Comments
Comment #2
samitk commentedIssue fixed.
Comment #3
sourabhjainI will review this.
Comment #4
sourabhjainI have reviewed patch #2 and its working fine. Moving it to RTBC.
Comment #6
rodrigoaguileraThanks for the patch and the review