Running phpcs command returns the following
Command
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/shorthand
Result
FILE: /drupal/shorthand-4.x/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
17 | WARNING | Line exceeds 80 characters; contains 131 characters
21 | WARNING | Line exceeds 80 characters; contains 98 characters
----------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/shorthand.install
---------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------
171 | ERROR | [x] Doc comment short description must end with a full stop
235 | ERROR | [x] Expected 1 blank line after function; 2 found
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Form/ShorthandSettingsForm.php
--------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
117 | ERROR | [x] The first index in a multi-value array must be on a new line
118 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
118 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Entity/ShorthandStory.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 28 ERRORS AND 1 WARNING AFFECTING 14 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
91 | ERROR | [x] There should be no white space after an opening "("
91 | ERROR | [x] Short array syntax must be used to define arrays
91 | ERROR | [x] Expected 1 space between "'without_assets'" and double arrow; 0 found
91 | ERROR | [x] Expected 1 space between double arrow and "true"; 0 found
91 | ERROR | [x] Expected 1 space before "=>"; 0 found
91 | ERROR | [x] Expected 1 space after "=>"; 0 found
91 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
93 | ERROR | [x] No space found before comment text; expected "// Publish the external assets to the selected publish configuration" but found "//Publish the external
| | assets to the selected publish configuration"
93 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
94 | ERROR | [x] Expected 1 space after IF keyword; 0 found
94 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
95 | ERROR | [x] No space found before comment text; expected "// Publish external assets" but found "//Publish external assets"
95 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
130 | ERROR | [x] No space found before comment text; expected "// Split based on external assets flag" but found "//Split based on external assets flag"
130 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
134 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
157 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
157 | ERROR | [x] Whitespace found at end of line
158 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
160 | ERROR | [x] Expected 1 space after IF keyword; 0 found
160 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
160 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
162 | ERROR | [x] Concat operator must be surrounded by a single space
411 | ERROR | [x] Whitespace found at end of line
426 | ERROR | [x] Whitespace found at end of line
468 | ERROR | [ ] Parameter $external_assets is not described in comment
486 | ERROR | [x] Expected 1 space before "?"; 0 found
486 | ERROR | [x] Concat operator must be surrounded by a single space
486 | ERROR | [x] Concat operator must be surrounded by a single space
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 27 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/ShorthandApiV2.php
--------------------------------------------------------------------------------------
FOUND 23 ERRORS AFFECTING 23 LINES
--------------------------------------------------------------------------------------
29 | ERROR | [x] Data types in @var tags need to be fully namespaced
36 | ERROR | [x] Data types in @var tags need to be fully namespaced
43 | ERROR | [x] Data types in @var tags need to be fully namespaced
50 | ERROR | [x] Data types in @var tags need to be fully namespaced
57 | ERROR | [x] Data types in @var tags need to be fully namespaced
64 | ERROR | [x] Data types in @param tags need to be fully namespaced
66 | ERROR | [x] Data types in @param tags need to be fully namespaced
68 | ERROR | [x] Data types in @param tags need to be fully namespaced
70 | ERROR | [x] Data types in @param tags need to be fully namespaced
75 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
78 | ERROR | [x] Additional blank lines found at end of doc comment
90 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
100 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
145 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
158 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
173 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
221 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
251 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
261 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
286 | ERROR | [x] Doc comment short description must end with a full stop
291 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
293 | ERROR | [x] There must be no blank lines after the function comment
306 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Plugin/Field/FieldWidget/StorySelectFieldWidget.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
62 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Plugin/Field/FieldWidget/PublishConfigurationSelectFieldWidget.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------
14 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
62 | ERROR | [x] Use null coalesce operator instead of ternary operator.
73 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Plugin/Field/FieldWidget/LocalShorthandStorySelectFieldWidget.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
88 | ERROR | [x] Use null coalesce operator instead of ternary operator.
90 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
90 | ERROR | [x] No space found before comment text; expected "// '#suffix' => '<div id="shorthand-stories-data">' . json_encode($this->shorthandStories) . '</div>',"
| | but found "//'#suffix' => '<div id="shorthand-stories-data">' . json_encode($this->shorthandStories) . '</div>',"
111 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Plugin/Field/FieldType/LocalShorthandFieldType.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 21 ERRORS AND 5 WARNINGS AFFECTING 24 LINES
--------------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
22 | ERROR | [x] Doc comment star missing
35 | ERROR | [x] No space found before comment text; expected "// 'size' => 'small'," but found "//'size' => 'small',"
59 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
62 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
64 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
65 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
66 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
66 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
68 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
68 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
69 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
70 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
71 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
72 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
74 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
76 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
77 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
78 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
79 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
81 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
82 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
83 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
85 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Plugin/Field/FieldFormatter/LocalShorthandFieldFormatter.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
55 | WARNING | [x] There must be no blank line following an inline comment
55 | WARNING | [ ] There must be no blank line following an inline comment
55 | ERROR | [x] No space found before comment text; expected "// $value = $this->parseContent($html);" but found "//$value = $this->parseContent($html);"
59 | WARNING | [ ] Line exceeds 80 characters; contains 134 characters
59 | ERROR | [x] No space found before comment text; expected "// '#allowed_tags' => ['article', 'div', 'p', 'h1', 'h2', 'h3', 'h4', 'picture', 'img', 'canvas',
| | 'source', 'video', 'figure']," but found "//'#allowed_tags' => ['article', 'div', 'p', 'h1', 'h2', 'h3', 'h4', 'picture', 'img', 'canvas', 'source',
| | 'video', 'figure'],"
61 | ERROR | [x] No space found before comment text; expected "// 'library' => ['shorthand/shorthand-story']," but found "//'library' => ['shorthand/shorthand-story'],"
78 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
83 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/ShorthandApiInterface.php
-------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------
32 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
33 | ERROR | [x] Parameter comment must end with a full stop
40 | ERROR | [ ] Parameter $config is not described in comment
46 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
46 | ERROR | [ ] Doc comment for parameter $publish does not match actual variable name $config
46 | ERROR | [x] Parameter comment must be on the next line
47 | ERROR | [x] Parameter comment must end with a full stop
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/ShorthandApi.php
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------
146 | WARNING | Only string literals should be passed to t() where possible
-----------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/Controller/RemoteCollectionController.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 31 ERRORS AND 13 WARNINGS AFFECTING 35 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
102 | ERROR | [x] No space found before comment text; expected "// 'key' => 'uri'," but found "//'key' => 'uri',"
109 | ERROR | [x] No space found before comment text; expected "// unset($story['image']);" but found "//unset($story['image']);"
109 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
123 | WARNING | [ ] Unused variable $updatedStory.
123 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
129 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
161 | ERROR | [x] No space found before comment text; expected "// 'Metadata'," but found "//'Metadata',"
167 | ERROR | [x] No space found before comment text; expected "// 'API version'," but found "//'API version',"
182 | ERROR | [x] Missing function doc comment
195 | WARNING | [x] There must be no blank line following an inline comment
195 | WARNING | [ ] There must be no blank line following an inline comment
195 | ERROR | [x] No space found before comment text; expected "// ->getStory($sid, ['without_assets' => TRUE]);" but found "//->getStory($sid, ['without_assets' =>
| | TRUE]);"
206 | ERROR | [x] No space found before comment text; expected "// $timestamp = \Drupal::time()->getCurrentTime();" but found "//$timestamp =
| | \Drupal::time()->getCurrentTime();"
216 | WARNING | [ ] Unused variable $updated_path.
217 | WARNING | [x] There must be no blank line following an inline comment
217 | WARNING | [ ] There must be no blank line following an inline comment
217 | ERROR | [x] No space found before comment text; expected "// $file_system->move($destination_path, $updated_path);" but found
| | "//$file_system->move($destination_path, $updated_path);"
225 | WARNING | [ ] Unused variable $title.
229 | WARNING | [ ] Unused variable $body.
235 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
242 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
246 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
247 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
247 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
248 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
252 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
253 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
253 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
254 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
258 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
259 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
259 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
260 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
265 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
266 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
267 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
268 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
269 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
270 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
271 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
277 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
278 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
279 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
291 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 33 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /drupal/shorthand-4.x/src/ShorthandUninstallValidator.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
13 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
------------------------------------------------------------------------------------------------------------------
Time: 1.21 secs; Memory: 14MB
Comments
Comment #3
vladimirausComment #4
jannakha commentedok
Comment #6
vladimirausreleased in
alpha-2Comment #7
vladimiraus