Problem/Motivation
C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig node_protector-3351258
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\node_protector-3351258\config\install\node_protector.settings.yml
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\node_protector-3351258\node_protector.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\node_protector-3351258\node_protector.module
----------------------------------------------------------------------------------------------------------------------------
FOUND 22 ERRORS AFFECTING 18 LINES
----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
6 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
7 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
8 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
9 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
10 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
11 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
15 | ERROR | [x] There must be no blank lines after the function comment
18 | ERROR | [x] Whitespace found at end of line
19 | ERROR | [x] Whitespace found at end of line
23 | ERROR | [x] Whitespace found at end of line
28 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
30 | ERROR | [x] Whitespace found at end of line
31 | ERROR | [x] Whitespace found at end of line
32 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
34 | ERROR | [x] Whitespace found at end of line
39 | ERROR | [x] Whitespace found at end of line
40 | ERROR | [x] Inline comments must start with a capital letter
40 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
40 | ERROR | [x] Comments may not appear after statements
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\node_protector-3351258\node_protector.routing.yml
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
16 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\node_protector-3351258\src\Controller\NodeProtectorController.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 9 LINES
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
4 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
5 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
6 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
9 | ERROR | [x] You must use "/**" style comments for a class comment
10 | ERROR | [x] Missing function doc comment
10 | ERROR | [x] Expected 1 blank line before function; 0 found
11 | ERROR | [x] Short array syntax must be used to define arrays
12 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Welcome to Node Protector.'
15 | ERROR | [x] Expected 1 newline at end of file; 0 found
15 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\node_protector-3351258\src\Form\NodeProtectorSettingsForm.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 3 WARNINGS AFFECTING 9 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
81 | ERROR | [x] Whitespace found at end of line
92 | WARNING | [x] There must be no blank line following an inline comment
92 | WARNING | [ ] There must be no blank line following an inline comment
92 | ERROR | [x] No space found before comment text; expected "// $config->set('node_protector_frontpage', $front_page);" but found "//$config->set('node_protector_frontpage', $front_page);"
93 | ERROR | [x] Whitespace found at end of line
97 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
97 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
100 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
109 | ERROR | [x] Whitespace found at end of line
111 | ERROR | [x] Expected 1 space after comma in argument list; 7 found
111 | ERROR | [x] Expected one space after the comma, 7 found
112 | ERROR | [x] Expected 1 space after comma in argument list; 6 found
112 | ERROR | [x] Expected one space after the comma, 6 found
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Time: 751ms; Memory: 6MB
Steps to reproduce
Run phpcs command on the module.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes