Problem/Motivation
Found this issues reported by phpcs:
FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/pdf/pdf.module
---------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 8 LINES
---------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
7 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
8 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
8 | ERROR | [x] Array indentation error, expected 3 spaces but found 2
9 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
9 | ERROR | [x] Array indentation error, expected 4 spaces but found 3
10 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
10 | WARNING | [x] A comma should follow the last multiline array item. Found: NULL
11 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
12 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
13 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------
FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/pdf/css/pdf.css
----------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
2 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
33 | ERROR | [x] Blank lines are not allowed in class definitions
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------
FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/pdf/pdf.routing.yml
---------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
7 | WARNING | The administration page callback should probably use "administer site
| | configuration" - which implies the user can change something - rather than "access
| | administration pages" which is about viewing but not changing configurations.
---------------------------------------------------------------------------------------------------
FILE: ...studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/pdf/src/Form/ConfigForm.php
---------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and not simply repeat
| | the class name
---------------------------------------------------------------------------------------------------
FILE: ...l.org/drupalorg-site/docroot/modules/contrib/pdf/src/Plugin/Field/FieldFormatter/PdfPages.php
---------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 3 WARNINGS AFFECTING 11 LINES
---------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
10 | ERROR | [ ] Missing short description in doc comment
20 | ERROR | [x] Missing function doc comment
26 | ERROR | [x] Missing function doc comment
29 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
35 | ERROR | [x] Missing function doc comment
42 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
48 | ERROR | [x] Missing function doc comment
57 | ERROR | [x] No space found before comment text; expected "// '#value' => TODO," but found
| | "//'#value' => TODO,"
82 | ERROR | [x] Expected 1 blank line after function; 0 found
83 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------
FILE: ...g/drupalorg-site/docroot/modules/contrib/pdf/src/Plugin/Field/FieldFormatter/PdfThumbnail.php
---------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 6 WARNINGS AFFECTING 14 LINES
---------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
10 | ERROR | [ ] Missing short description in doc comment
19 | ERROR | [x] Missing function doc comment
19 | ERROR | [x] Expected 1 blank line before function; 0 found
27 | ERROR | [x] Missing function doc comment
31 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
38 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
44 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
49 | ERROR | [x] Missing function doc comment
59 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
62 | WARNING | [x] A comma should follow the last multiline array item. Found: $height
68 | ERROR | [x] Missing function doc comment
76 | ERROR | [x] No space found before comment text; expected "// '#value' => ," but found
| | "//'#value' => ,"
103 | ERROR | [x] Expected 1 blank line after function; 0 found
104 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------
FILE: ...org/drupalorg-site/docroot/modules/contrib/pdf/src/Plugin/Field/FieldFormatter/PdfDefault.php
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 7 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------
10 | ERROR | Missing short description in doc comment
46 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
139 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
139 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
139 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
139 | WARNING | Do not concatenate strings to translatable strings, they should be part of the
| | t() argument and you should use placeholders
139 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
153 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------
Time: 277ms; Memory: 10MB
Steps to reproduce
Run this command in the module folder: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
Proposed resolution
Remaining tasks
FILE: ...org/drupalorg-site/docroot/modules/contrib/pdf/src/Plugin/Field/FieldFormatter/PdfDefault.php
---------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
156 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------
Time: 214ms; Memory: 10MB