Problem/Motivation
Getting following error/warnings.
FILE: /var/www/html/modules/contrib/keyboard_shortcuts/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 107 characters
17 | WARNING | Line exceeds 80 characters; contains 94 characters
----------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/keyboard_shortcuts/keyboard_shortcuts.module
----------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------------------------------------------------------------------
4 | ERROR | [x] The second line in the file doc comment must be "@file"
20 | ERROR | [x] Expected 1 space before "="; 0 found
20 | ERROR | [x] Expected 1 space after "="; 0 found
44 | WARNING | [ ] Only string literals should be passed to t() where possible
46 | WARNING | [x] A comma should follow the last multiline array item. Found: '/admin/config/user-interface/keyboard-shortcuts'
54 | WARNING | [ ] Hook implementations should not duplicate @param documentation
54 | ERROR | [ ] Missing parameter comment
54 | ERROR | [ ] Missing parameter type
66 | ERROR | [x] There should be no white space after an opening "("
75 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
77 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/keyboard_shortcuts/src/Form/KeyboardShortcutsSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 42 ERRORS AND 13 WARNINGS AFFECTING 45 LINES
-------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Missing class doc comment
30 | ERROR | [ ] Description for the @return value is missing
62 | WARNING | [ ] Role::loadMultiple calls should be avoided in classes, use dependency injection instead
63 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
68 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
89 | ERROR | [x] Short array syntax must be used to define arrays
93 | WARNING | [x] A comma should follow the last multiline array item. Found: )
96 | ERROR | [x] Short array syntax must be used to define arrays
101 | WARNING | [x] A comma should follow the last multiline array item. Found: true
101 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
104 | ERROR | [x] Short array syntax must be used to define arrays
109 | WARNING | [x] A comma should follow the last multiline array item. Found: true
109 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
112 | ERROR | [x] Short array syntax must be used to define arrays
121 | ERROR | [x] Short array syntax must be used to define arrays
129 | ERROR | [x] Short array syntax must be used to define arrays
136 | ERROR | [x] Short array syntax must be used to define arrays
143 | ERROR | [x] Short array syntax must be used to define arrays
149 | WARNING | [x] A comma should follow the last multiline array item. Found: true
149 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
152 | ERROR | [x] Short array syntax must be used to define arrays
156 | WARNING | [x] A comma should follow the last multiline array item. Found: )
161 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
162 | ERROR | [x] Short array syntax must be used to define arrays
166 | ERROR | [x] Short array syntax must be used to define arrays
167 | WARNING | [ ] #options values usually have to run through t() for translation
168 | WARNING | [ ] #options values usually have to run through t() for translation
169 | WARNING | [ ] #options values usually have to run through t() for translation
173 | ERROR | [x] Concat operator must be surrounded by a single space
173 | ERROR | [x] Concat operator must be surrounded by a single space
177 | ERROR | [x] Short array syntax must be used to define arrays
184 | ERROR | [x] Concat operator must be surrounded by a single space
184 | ERROR | [x] Concat operator must be surrounded by a single space
190 | ERROR | [x] Short array syntax must be used to define arrays
197 | ERROR | [x] Concat operator must be surrounded by a single space
197 | ERROR | [x] Concat operator must be surrounded by a single space
199 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
206 | ERROR | [x] Short array syntax must be used to define arrays
213 | ERROR | [x] Concat operator must be surrounded by a single space
213 | ERROR | [x] Concat operator must be surrounded by a single space
226 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
244 | WARNING | [ ] Only string literals should be passed to t() where possible
244 | WARNING | [x] A comma should follow the last multiline array item. Found: )
259 | ERROR | [x] There should be no white space before a closing ")"
259 | ERROR | [x] Expected 0 spaces before closing parenthesis; 1 found
267 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
275 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
282 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
282 | ERROR | [x] Expected one space after the comma, 2 found
298 | ERROR | [x] Missing function doc comment
306 | ERROR | [x] Missing function doc comment
310 | ERROR | [x] Missing function doc comment
320 | ERROR | [x] Missing function doc comment
335 | ERROR | [x] Expected 1 blank line after function; 0 found
336 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 49 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------
Time: 2.2 secs; Memory: 6MB
Steps to reproduce
Run following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/keyboard_shortcuts/
Proposed resolution
Above error/warnings need to be fixed.