Problem/Motivation
Getting following error/warnings:
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\advanced_help_block.module
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | WARNING | [x] Unused use statement
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\library\css\ahb.css
--------------------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 14 LINES
--------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
9 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
10 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\src\AdvancedHelpBlockAccessControlHandler.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\src\AdvancedHelpBlockInterface.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\src\AdvancedHelpBlockViewsData.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\src\Entity\AdvancedHelpBlock.php
-----------------------------------------------------------------------------------------------------------
FOUND 15 ERRORS AND 8 WARNINGS AFFECTING 22 LINES
-----------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
6 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
115 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
151 | ERROR | [x] Short array syntax must be used to define arrays
179 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
189 | WARNING | [x] There must be no blank line following an inline comment
189 | WARNING | [ ] There must be no blank line following an inline comment
195 | ERROR | [x] Short array syntax must be used to define arrays
202 | ERROR | [x] Short array syntax must be used to define arrays
209 | ERROR | [x] Short array syntax must be used to define arrays
221 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
225 | ERROR | [x] Short array syntax must be used to define arrays
231 | ERROR | [x] Short array syntax must be used to define arrays
238 | ERROR | [x] Short array syntax must be used to define arrays
240 | WARNING | [x] A comma should follow the last multiline array item. Found: 5
251 | ERROR | [x] Short array syntax must be used to define arrays
252 | ERROR | [x] Short array syntax must be used to define arrays
260 | ERROR | [x] Short array syntax must be used to define arrays
267 | ERROR | [x] Short array syntax must be used to define arrays
338 | ERROR | [x] Expected 1 blank line after function; 0 found
339 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\src\Form\AdvancedHelpBlockDeleteForm.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
23 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\src\Form\AdvancedHelpBlockForm.php
-----------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
32 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
44 | WARNING | [x] A comma should follow the last multiline array item. Found: )
54 | WARNING | [x] A comma should follow the last multiline array item. Found: )
62 | ERROR | [x] Expected 1 blank line after function; 0 found
63 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\project_10\web\modules\contrib\advanced_help_block\src\Form\AdvancedHelpBlockSettingsForm.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 8 WARNINGS AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
16 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
41 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
46 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
48 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
49 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
49 | WARNING | [x] A comma should follow the last multiline array item. Found: )
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------
Steps to reproduce
Run following command:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml advanced_help_block/
Proposed resolution
Above error/warnings need to be fixed.