Problem/Motivation
Many errors/warning are produced by phpcs snifffer.
FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/addtocal/src/Plugin/Field/FieldFormatter/AddtocalView.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
189 | ERROR | The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/addtocal/addtocal.module
--------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
3 | ERROR | [x] The second line in the file doc comment must be "@file"
49 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
53 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
79 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------
FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/addtocal/addtocal.js
-------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------
7 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
28 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------
FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/addtocal/README.txt
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------
14 | WARNING | Line exceeds 80 characters; contains 82 characters
15 | WARNING | Line exceeds 80 characters; contains 86 characters
16 | WARNING | Line exceeds 80 characters; contains 112 characters
19 | WARNING | Line exceeds 80 characters; contains 81 characters
20 | WARNING | Line exceeds 80 characters; contains 106 characters
--------------------------------------------------------------------------
FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/addtocal/addtocal-download.js
-------------------------------------------------------------------------------------------------
FOUND 109 ERRORS AFFECTING 51 LINES
-------------------------------------------------------------------------------------------------
31 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
31 | ERROR | [x] Expected 1 space before opening brace; found 0
36 | ERROR | [x] Expected 1 space before "="; 0 found
36 | ERROR | [x] Space found before semicolon; expected "Blob;" but found "Blob ;"
38 | ERROR | [x] Expected 1 space before "==="; 0 found
38 | ERROR | [x] Expected 1 space after "==="; 0 found
39 | ERROR | [x] Expected 1 space before "="; 0 found
39 | ERROR | [x] Expected 1 space after "="; 0 found
40 | ERROR | [x] Expected 1 space before "="; 0 found
40 | ERROR | [x] Expected 1 space after "="; 0 found
41 | ERROR | [x] Expected 1 space before "="; 0 found
41 | ERROR | [x] Expected 1 space after "="; 0 found
43 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
45 | ERROR | [x] Expected 1 space before "<"; 0 found
49 | ERROR | [x] Expected 1 space before "="; 0 found
49 | ERROR | [x] Expected 1 space after "="; 0 found
50 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
52 | ERROR | [x] Expected 1 space before "="; 0 found
52 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
52 | ERROR | [x] Expected 1 space before opening brace; found 0
55 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
55 | ERROR | [x] Expected 1 space before opening brace; found 0
59 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
64 | ERROR | [x] Expected 1 space before "*"; 0 found
64 | ERROR | [x] Expected 1 space after "*"; 0 found
64 | ERROR | [x] Expected 1 space before "*"; 0 found
64 | ERROR | [x] Expected 1 space after "*"; 0 found
65 | ERROR | [x] Expected 1 space before "="; 0 found
65 | ERROR | [x] Expected 1 space after "="; 0 found
66 | ERROR | [x] Expected 1 space before "="; 0 found
66 | ERROR | [x] Expected 1 space after "="; 0 found
68 | ERROR | [x] Expected 1 space after "?"; 2 found
70 | ERROR | [x] Space after closing parenthesis of function call prohibited
70 | ERROR | [x] Space found before semicolon; expected ");" but found ") ;"
75 | ERROR | [x] Expected 1 space before "="; 0 found
75 | ERROR | [x] Expected 1 space after "="; 0 found
75 | ERROR | [x] Expected 1 space before "="; 0 found
75 | ERROR | [x] Expected 1 space before "="; 0 found
75 | ERROR | [x] Expected 1 space after "="; 0 found
76 | ERROR | [x] Inline control structures are not allowed
76 | ERROR | [x] Expected 1 space after first semicolon of FOR loop; 0 found
76 | ERROR | [x] Expected 1 space before "<"; 0 found
76 | ERROR | [x] Expected 1 space after "<"; 0 found
76 | ERROR | [x] Expected 1 space after second semicolon of FOR loop; 0 found
76 | ERROR | [x] Expected 1 space before "="; 0 found
77 | ERROR | [x] Expected 1 space before "="; 0 found
77 | ERROR | [x] Expected 1 space after "="; 0 found
82 | ERROR | [x] Space after closing parenthesis of function call prohibited
82 | ERROR | [x] Space found before semicolon; expected ");" but found ") ;"
83 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
86 | ERROR | [x] Expected 1 space before "="; 0 found
87 | ERROR | [x] Expected 1 space before "="; 0 found
88 | ERROR | [x] Expected 1 space before ">"; 0 found
88 | ERROR | [x] Expected 1 space after ">"; 0 found
88 | ERROR | [x] Expected 1 space before ":"; 0 found
89 | ERROR | [x] Expected 1 space before "="; 0 found
90 | ERROR | [x] Expected 1 space before "="; 0 found
91 | ERROR | [x] Expected 1 space before "="; 0 found
92 | ERROR | [x] Expected 1 space before "="; 0 found
93 | ERROR | [x] Expected 1 space before "="; 0 found
95 | ERROR | [x] Inline control structures are not allowed
95 | ERROR | [x] Expected 1 space after first semicolon of FOR loop; 0 found
95 | ERROR | [x] Expected 1 space before "<"; 0 found
95 | ERROR | [x] Expected 1 space after "<"; 0 found
95 | ERROR | [x] Expected 1 space after second semicolon of FOR loop; 0 found
95 | ERROR | [x] Expected 1 space before "="; 0 found
108 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
113 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
116 | ERROR | [x] Expected 1 space before "==="; 0 found
116 | ERROR | [x] Expected 1 space after "==="; 0 found
116 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
116 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
116 | ERROR | [x] Expected 1 space before opening brace; found 0
118 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
123 | ERROR | [x] Inline control structures are not allowed
123 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
123 | ERROR | [x] Expected 1 space before "="; 0 found
123 | ERROR | [x] Expected 1 space after "="; 0 found
123 | ERROR | [x] Expected 1 space before "+"; 0 found
123 | ERROR | [x] Expected 1 space after "+"; 0 found
125 | ERROR | [x] Expected 1 space before "="; 0 found
125 | ERROR | [x] Expected 1 space after "="; 0 found
127 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
135 | ERROR | [x] Expected 1 space before "="; 0 found
135 | ERROR | [x] Expected 1 space after "="; 0 found
135 | ERROR | [x] Expected 1 space before "+"; 0 found
135 | ERROR | [x] Expected 1 space after "+"; 0 found
137 | ERROR | [x] Expected 1 space before "="; 0 found
137 | ERROR | [x] Expected 1 space after "="; 0 found
138 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
138 | ERROR | [x] Expected 1 space before opening brace; found 0
141 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 4 empty lines
144 | ERROR | [ ] More than 2 empty lines are not allowed
150 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
153 | ERROR | [x] Expected 1 space before "==="; 0 found
153 | ERROR | [x] Expected 1 space after "==="; 0 found
155 | ERROR | [x] Expected 1 space after "+"; 2 found
155 | ERROR | [x] Expected 1 space before "+"; 3 found
155 | ERROR | [x] Expected 1 space before "+"; 2 found
155 | ERROR | [x] Expected 1 space after "+"; 2 found
157 | ERROR | [x] Expected 1 space after "+"; 2 found
157 | ERROR | [x] Expected 1 space before "+"; 3 found
162 | ERROR | [x] Expected 1 space before "="; 0 found
162 | ERROR | [x] Expected 1 space after "="; 0 found
163 | ERROR | [x] Expected 1 space before "="; 0 found
163 | ERROR | [x] Expected 1 space after "="; 0 found
163 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
163 | ERROR | [x] Expected 1 space before opening brace; found 0
168 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 108 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------
FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/addtocal/addtocal.install
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
3 | ERROR | [x] The second line in the file doc comment must be "@file"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Steps to reproduce
Run this command inside addtocal folder.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,js .
Proposed resolution
Fixing the issues and providing a patch.
Remaining tasks
User interface changes
API changes
Data model changes