Problem/Motivation
Getting following error/warnings
FILE: /var/www/html/modules/contrib/search_overrides/search_overrides.module
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 3 WARNINGS AFFECTING 12 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
53 | ERROR | [x] Inline comments must start with a capital letter
53 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
56 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
91 | WARNING | [x] 'TODO: prevent duplicates from being stored.' should match the format '@todo Fix problem X here.'
97 | WARNING | [x] 'TODO: make this work with more entities than nodes.' should match the format '@todo Fix problem X here.'
99 | ERROR | [x] No space found before comment text; expected "// $hash . '-base-entity:node/' . $id . ':' . $language;" but found "//$hash . '-base-entity:node/' .
| | $id . ':' . $language;"
105 | WARNING | [x] 'TODO: make this work with more entities than nodes.' should match the format '@todo Fix problem X here.'
126 | ERROR | [x] Expected newline after closing brace
197 | ERROR | [x] Calling class constructors must always include parentheses
207 | ERROR | [x] Expected 1 space after IF keyword; 0 found
211 | ERROR | [x] Calling class constructors must always include parentheses
215 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
278 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/search_overrides.install
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-----------------------------------------------------------------------------
39 | WARNING | [x] There must be no blank line following an inline comment
39 | WARNING | [ ] There must be no blank line following an inline comment
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
99 | WARNING | Line exceeds 80 characters; contains 93 characters
----------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/src/Form/SearchOverrideForm.php
--------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------------
37 | ERROR | [x] Missing function doc comment
40 | WARNING | [ ] Unused variable $values.
41 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
52 | ERROR | [x] Missing function doc comment
90 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
111 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
130 | ERROR | [x] Expected newline after closing brace
132 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/src/Form/SearchOverrideSettingsForm.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 7 WARNINGS AFFECTING 9 LINES
---------------------------------------------------------------------------------------------------------------------------
50 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
78 | ERROR | [x] The first index in a multi-value array must be on a new line
79 | WARNING | [x] A comma should follow the last multiline array item. Found: 'override-previews'
80 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
98 | ERROR | [x] The first index in a multi-value array must be on a new line
99 | WARNING | [x] A comma should follow the last multiline array item. Found: 'preview-query'
107 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
116 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
123 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/src/SearchOverridesTrait.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
41 | WARNING | [ ] Unused variable $entity.
46 | WARNING | [ ] Unused variable $entity.
50 | WARNING | [x] 'TODO: construct an object that can provide needed methods e.g.' should match the format '@todo Fix problem X here.'
56 | ERROR | [x] Missing function doc comment
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/src/Entity/SearchOverrideListBuilder.php
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
33 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/src/Element/AddOverride.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
47 | ERROR | [x] Short array syntax must be used to define arrays
77 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
77 | ERROR | [x] Comments may not appear after statements
77 | ERROR | [x] No space found before comment text; expected "// alternative notation" but found "//alternative notation"
77 | ERROR | [x] Inline comments must start with a capital letter
77 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
78 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
78 | ERROR | [x] Comments may not appear after statements
80 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
80 | ERROR | [x] Comments may not appear after statements
97 | ERROR | [x] Data types in @param tags need to be fully namespaced
100 | ERROR | [x] Data types in @return tags need to be fully namespaced
100 | ERROR | [x] Return type must not contain variable name "$response"
176 | ERROR | [x] Calling class constructors must always include parentheses
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/src/Controller/Manager.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 5 WARNINGS AFFECTING 11 LINES
------------------------------------------------------------------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
23 | ERROR | [x] Missing function doc comment
26 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
39 | ERROR | [x] Missing function doc comment
40 | WARNING | [ ] Unused variable $message.
42 | ERROR | [x] Calling class constructors must always include parentheses
45 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
54 | ERROR | [x] Missing function doc comment
67 | ERROR | [x] Expected 1 space between comma and "'exnid'"; 0 found
67 | ERROR | [x] Expected one space after the comma, 0 found
81 | ERROR | [x] Missing function doc comment
94 | WARNING | [x] '@todo: find a reliable way to create a title for content from a' should match the format '@todo Fix problem X here.'
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/search_overrides/src/SearchOverrideReferencer.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 15 WARNINGS AFFECTING 21 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
13 | WARNING | [x] Unused use statement
15 | WARNING | [x] Unused use statement
24 | ERROR | [ ] Missing short description in doc comment
27 | ERROR | [ ] Class property $entity_type_id should use lowerCamel naming without underscores
29 | ERROR | [ ] Missing short description in doc comment
34 | ERROR | [ ] Missing short description in doc comment
61 | ERROR | [x] Use "elseif" in place of "else if"
91 | ERROR | [ ] Public method name "SearchOverrideReferencer::EntityOverridesTable" is not in lowerCamel format
92 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
92 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
102 | ERROR | [x] Expected one space after the comma, 0 found
127 | WARNING | [x] 'TODO: make the specifics configurable in the settings.' should match the format '@todo Fix problem X here.'
159 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
160 | ERROR | [ ] The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
160 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
167 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
Time: 3.04 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/search_overrides/
Proposed resolution
Above error/warnings need to be fixed