Fix the issues reported by phpcs

Created on 6 July 2023, 12 months ago

Problem/Motivation

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/src/Form/EatAdminSettingsForm.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 9 WARNINGS AFFECTING 16 LINES
----------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityType.
11 | ERROR | [x] Missing class doc comment
31 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
35 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
50 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
59 | ERROR | [x] Concat operator must be surrounded by a single space
59 | ERROR | [x] Concat operator must be surrounded by a single space
66 | WARNING | [x] A comma should follow the last multiline array item. Found: $v
69 | WARNING | [ ] Vocabulary::loadMultiple calls should be avoided in classes, use dependency injection instead
80 | ERROR | [x] Concat operator must be surrounded by a single space
80 | ERROR | [x] Concat operator must be surrounded by a single space
80 | ERROR | [x] Concat operator must be surrounded by a single space
92 | ERROR | [x] Concat operator must be surrounded by a single space
92 | ERROR | [x] Concat operator must be surrounded by a single space
92 | ERROR | [x] Concat operator must be surrounded by a single space
109 | WARNING | [x] A comma should follow the last multiline array item. Found: )
120 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
135 | WARNING | [x] A comma should follow the last multiline array item. Found: $terms
139 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
141 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/src/Form/BatchImport.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
27 | WARNING | [x] A comma should follow the last multiline array item. Found: )
37 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
40 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/src/Eat.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 41 ERRORS AND 9 WARNINGS AFFECTING 35 LINES
-------------------------------------------------------------------------------------------------------------------------------
17 | ERROR | [x] Doc comment short description must be on the first line
22 | ERROR | [ ] Parameter tags must be defined first in a doc comment
22 | ERROR | [ ] Missing parameter comment
22 | ERROR | [ ] Missing parameter type
23 | ERROR | [ ] Missing parameter comment
23 | ERROR | [ ] Missing parameter type
24 | ERROR | [ ] Missing parameter comment
24 | ERROR | [ ] Missing parameter type
26 | ERROR | [ ] Description for the @return value is missing
27 | ERROR | [x] Separate the @return and @throws sections by a blank line.
30 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
41 | WARNING | [x] A comma should follow the last multiline array item. Found: $vocabulary
51 | ERROR | [ ] Parameter tags must be defined first in a doc comment
51 | ERROR | [ ] Missing parameter comment
51 | ERROR | [ ] Missing parameter type
53 | ERROR | [ ] Description for the @return value is missing
66 | ERROR | [ ] Description for the @return value is missing
78 | ERROR | [ ] Description for the @return value is missing
98 | ERROR | [ ] Description for the @return value is missing
111 | ERROR | [ ] Missing parameter comment
111 | ERROR | [ ] Missing parameter type
113 | ERROR | [ ] Description for the @return value is missing
118 | WARNING | [ ] Unused variable $k.
128 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
133 | WARNING | [x] '@todo: make usable with multiple entity types.' should match the format '@todo Fix problem X here.'
134 | WARNING | [ ] Unused variable $key.
144 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
164 | WARNING | [x] '@todo: give better names for variables.' should match the format '@todo Fix problem X here.'
165 | WARNING | [ ] Unused variable $k.
166 | WARNING | [ ] Unused variable $vocab_name.
179 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
180 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
181 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
181 | ERROR | [ ] Missing parameter comment
181 | ERROR | [ ] Missing parameter type
182 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
182 | ERROR | [ ] Missing parameter comment
182 | ERROR | [ ] Missing parameter type
183 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
183 | ERROR | [ ] Missing parameter comment
183 | ERROR | [ ] Missing parameter type
184 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
184 | ERROR | [x] Separate the @param and @throws sections by a blank line.
185 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
194 | ERROR | [ ] Missing parameter type
197 | ERROR | [ ] Return type missing for @return tag in function comment
198 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
212 | ERROR | [ ] Missing parameter comment
212 | ERROR | [ ] Missing parameter type
214 | ERROR | [ ] Description for the @return value is missing
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/src/Plugin/views/argument_default/EatFilters.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 3 WARNINGS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\node\NodeInterface.
12 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
16 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
82 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
84 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
92 | ERROR | [x] Concat operator must be surrounded by a single space
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/eat.module
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 50 ERRORS AND 8 WARNINGS AFFECTING 47 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
7 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\taxonomy\Entity\Term.
12 | WARNING | [x] Unused use statement
13 | WARNING | [x] Unused use statement
26 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
58 | WARNING | [x] '@todo: Add check for all entity types.' should match the format '@todo Fix problem X here.'
123 | ERROR | [ ] Missing short description in doc comment
124 | ERROR | [ ] The text '@deprecated - use Eat::loadTid. Load entity tid.' does not match the standard format: @deprecated in %deprecation-version% and is removed
| | from %removal-version%. %extra-info%.
124 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
128 | ERROR | [ ] Missing parameter comment
128 | ERROR | [ ] Missing parameter type
130 | ERROR | [ ] Description for the @return value is missing
140 | ERROR | [ ] Missing short description in doc comment
141 | ERROR | [ ] The text '@deprecated - use Eat::addTerm(). eat_add_term' does not match the standard format: @deprecated in %deprecation-version% and is removed
| | from %removal-version%. %extra-info%.
141 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
145 | ERROR | [ ] Missing parameter comment
145 | ERROR | [ ] Missing parameter type
146 | ERROR | [ ] Missing parameter comment
146 | ERROR | [ ] Missing parameter type
147 | ERROR | [ ] Missing parameter type
147 | ERROR | [x] Parameter comment must be on the next line
151 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
162 | WARNING | [x] A comma should follow the last multiline array item. Found: $vocabulary
169 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
170 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
171 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
171 | ERROR | [x] Expected 1 space after SWITCH keyword; 0 found
172 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
173 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
174 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
175 | ERROR | [x] Case breaking statements must be followed by a single blank line
175 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 12
176 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
177 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
178 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
179 | ERROR | [x] Case breaking statements must be followed by a single blank line
179 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 12
180 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
181 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 12
182 | WARNING | [ ] Code after the RETURN statement on line 181 cannot be executed
182 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 12
183 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
184 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
186 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
187 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 8
192 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
193 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
194 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
196 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
197 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
198 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 8
200 | WARNING | [x] '@todo: Add non deprecated delete.' should match the format '@todo Fix problem X here.'
200 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
201 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
204 | ERROR | [x] Object operator not indented correctly; expected 8 spaces but found 6
218 | ERROR | [x] Expected 1 newline at end of file; 3 found
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 43 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/eat.drush.inc
--------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
7 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
13 | ERROR | [x] Doc comment long description must start with a capital letter
15 | ERROR | [ ] Description for the @return value is missing
17 | ERROR | [x] Expected 1 blank line before function; 2 found
24 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Vocabulary name'
26 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
35 | ERROR | [ ] Missing parameter comment
36 | ERROR | [ ] Missing parameter comment
37 | ERROR | [ ] Missing parameter comment
41 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/eat.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: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/eat.install
--------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
24 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Entity ID'
30 | WARNING | [x] A comma should follow the last multiline array item. Found: 'tid'
47 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
48 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/eat.links.menu.yml
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
56 | WARNING | Line exceeds 80 characters; contains 85 characters
----------------------------------------------------------------------

Time: 130ms; Memory: 10MB

Steps to reproduce
Excute the query
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig /var/www/html/VB/drupal-10.1.0/modules/contrib/eat/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: outdated

Version

3.0

Component

Code

Created by

🇮🇳India Indra patil Bangalore

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024