Problem/Motivation
FILE: ...drupal10/web/modules/contrib/random_frontpage/random_frontpage.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: ...les/contrib/random_frontpage/src/Controller/random_frontpageController.php
--------------------------------------------------------------------------------
FOUND 47 ERRORS AND 5 WARNINGS AFFECTING 40 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
| | line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
| | with a file doc comment
8 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
12 | WARNING | [x] Unused use statement
17 | WARNING | [x] Unused use statement
20 | ERROR | [x] Doc comment short description must end with a full stop
21 | ERROR | [x] There must be exactly one blank line before the tags in a
| | doc comment
23 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
23 | ERROR | [x] Additional blank lines found at end of doc comment
24 | ERROR | [ ] Class name must begin with a capital letter
24 | ERROR | [ ] Class name must use UpperCamel naming without underscores
29 | ERROR | [x] Data types in @var tags need to be fully namespaced
29 | ERROR | [x] Do not append variable name "$config" to the type
| | declaration in a member variable comment
33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
36 | ERROR | [x] Data types in @var tags need to be fully namespaced
36 | ERROR | [x] Do not append variable name "$renderer" to the type
| | declaration in a member variable comment
43 | ERROR | [x] Data types in @var tags need to be fully namespaced
43 | ERROR | [x] Do not append variable name "$killSwitch" to the type
| | declaration in a member variable comment
50 | ERROR | [x] Data types in @var tags need to be fully namespaced
50 | ERROR | [x] Do not append variable name "$entityTypeManager" to the
| | type declaration in a member variable comment
52 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
54 | ERROR | [ ] Missing short description in doc comment
55 | ERROR | [ ] Missing parameter comment
55 | ERROR | [x] Data types in @param tags need to be fully namespaced
56 | ERROR | [ ] Missing parameter comment
56 | ERROR | [x] Data types in @param tags need to be fully namespaced
57 | ERROR | [ ] Missing parameter comment
57 | ERROR | [x] Data types in @param tags need to be fully namespaced
58 | ERROR | [ ] Missing parameter comment
58 | ERROR | [x] Data types in @param tags need to be fully namespaced
60 | ERROR | [x] Additional blank lines found at end of doc comment
72 | ERROR | [ ] Missing short description in doc comment
73 | ERROR | [ ] Missing parameter comment
73 | ERROR | [x] Data types in @param tags need to be fully namespaced
74 | ERROR | [ ] Description for the @return value is missing
75 | ERROR | [x] Data types in @throws tags need to be fully namespaced
76 | ERROR | [x] Data types in @throws tags need to be fully namespaced
78 | ERROR | [x] Additional blank lines found at end of doc comment
91 | ERROR | [ ] Description for the @return value is missing
92 | ERROR | [x] Separate the @return and @throws sections by a blank line.
92 | ERROR | [x] Data types in @throws tags need to be fully namespaced
93 | ERROR | [x] Data types in @throws tags need to be fully namespaced
95 | ERROR | [x] Additional blank lines found at end of doc comment
102 | ERROR | [x] Short array syntax must be used to define arrays
110 | ERROR | [x] Expected newline after closing brace
118 | ERROR | [x] Short array syntax must be used to define arrays
119 | ERROR | [x] Expected newline after closing brace
120 | ERROR | [ ] Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
121 | ERROR | [x] Short array syntax must be used to define arrays
125 | ERROR | [x] Expected 1 blank line after function; 0 found
126 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 39 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...web/modules/contrib/random_frontpage/src/Form/random_frontpageSettings.php
--------------------------------------------------------------------------------
FOUND 45 ERRORS AFFECTING 33 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
| | with a file doc comment
12 | ERROR | [x] When importing a class with "use", do not include a leading
| | \
14 | ERROR | [x] Missing class doc comment
14 | ERROR | [ ] Class name must begin with a capital letter
14 | ERROR | [ ] Class name must use UpperCamel naming without underscores
26 | ERROR | [x] Data types in @var tags need to be fully namespaced
26 | ERROR | [x] Do not append variable name "$configFactory" to the type
| | declaration in a member variable comment
30 | ERROR | [ ] Missing short description in doc comment
31 | ERROR | [x] Data types in @var tags need to be fully namespaced
31 | ERROR | [x] Do not append variable name "$entityDisplayRepository" to
| | the type declaration in a member variable comment
33 | ERROR | [x] Additional blank lines found at end of doc comment
39 | ERROR | [ ] Missing parameter comment
39 | ERROR | [x] Data types in @param tags need to be fully namespaced
40 | ERROR | [ ] Missing parameter comment
40 | ERROR | [x] Data types in @param tags need to be fully namespaced
42 | ERROR | [x] Additional blank lines found at end of doc comment
53 | ERROR | [ ] Missing parameter comment
53 | ERROR | [x] Data types in @param tags need to be fully namespaced
54 | ERROR | [x] Separate the @param and @return sections by a blank line.
54 | ERROR | [ ] Description for the @return value is missing
54 | ERROR | [x] Data types in @return tags need to be fully namespaced
56 | ERROR | [x] Additional blank lines found at end of doc comment
67 | ERROR | [ ] Description for the @return value is missing
69 | ERROR | [x] Additional blank lines found at end of doc comment
74 | ERROR | [ ] Missing short description in doc comment
75 | ERROR | [ ] Description for the @return value is missing
77 | ERROR | [x] Additional blank lines found at end of doc comment
81 | ERROR | [x] Array closing indentation error, expected 4 spaces but found
| | 6
87 | ERROR | [ ] Description for the @return value is missing
89 | ERROR | [x] Additional blank lines found at end of doc comment
102 | ERROR | [ ] Missing parameter comment
103 | ERROR | [ ] Missing parameter comment
103 | ERROR | [x] Data types in @param tags need to be fully namespaced
104 | ERROR | [x] Separate the @param and @return sections by a blank line.
104 | ERROR | [ ] Description for the @return value is missing
106 | ERROR | [x] Additional blank lines found at end of doc comment
109 | ERROR | [x] Short array syntax must be used to define arrays
116 | ERROR | [x] Array closing indentation error, expected 4 spaces but found
| | 6
118 | ERROR | [x] Short array syntax must be used to define arrays
125 | ERROR | [x] Array closing indentation error, expected 4 spaces but found
| | 6
132 | ERROR | [ ] Missing parameter comment
133 | ERROR | [ ] Missing parameter comment
133 | ERROR | [x] Data types in @param tags need to be fully namespaced
135 | ERROR | [x] Additional blank lines found at end of doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 29 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...on/drupal10/web/modules/contrib/random_frontpage/random_frontpage.info.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
1 | WARNING | [ ] Remove "version" from the info file, it will be added by
| | drupal.org packaging automatically
6 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...tion/drupal10/web/modules/contrib/random_frontpage/random_frontpage.module
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
5 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 373ms; Memory: 10MB
Steps to reproduce
Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig random_frontpage/
Proposed resolution
Fix all the issues reported for Drupal and DrupalPractice standards
Remaining tasks
Patch review.