Fix the issue reported by phpcs.

Created on 23 June 2023, about 1 year ago
Updated 26 June 2023, about 1 year ago

Problem/Motivation

Getting following error/warnings:

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\entity_expand\entity_expand.module
--------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
6 | ERROR | [x] Doc comment short description must start with a capital letter
8 | ERROR | [ ] Missing parameter comment
8 | ERROR | [x] Data types in @param tags need to be fully namespaced
9 | ERROR | [x] Separate the @param and @return sections by a blank line.
9 | ERROR | [ ] Description for the @return value is missing
9 | ERROR | [x] Data types in @return tags need to be fully namespaced
12 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\entity_expand\README.txt
--------------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 10 LINES
--------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | ERROR | [x] There must be one blank line after the last USE statement; 0 found;
10 | ERROR | [x] Missing class doc comment
11 | ERROR | [x] Missing function doc comment
11 | ERROR | [x] Expected 1 blank line before function; 0 found
11 | ERROR | [x] Expected 1 blank line after function; 0 found
12 | ERROR | [x] Missing function doc comment
12 | ERROR | [x] Expected 1 blank line after function; 0 found
13 | ERROR | [x] Missing function doc comment
13 | ERROR | [x] Expected 1 blank line after function; 0 found
14 | ERROR | [x] Missing function doc comment
15 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
16 | ERROR | [x] Expected 1 blank line after function; 0 found
17 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\entity_expand\src\EntityExpandBase.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 102 ERRORS AND 2 WARNINGS AFFECTING 73 LINES
-------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
2 | ERROR | [x] There must be one blank line after the namespace declaration
9 | ERROR | [x] Missing class doc comment
11 | ERROR | [ ] Missing short description in doc comment
12 | ERROR | [x] Data types in @var tags need to be fully namespaced
17 | ERROR | [x] Doc comment short description must start with a capital letter
20 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
20 | ERROR | [ ] Missing parameter comment
20 | ERROR | [x] Data types in @param tags need to be fully namespaced
27 | ERROR | [x] Missing function doc comment
32 | ERROR | [x] Doc comment short description must start with a capital letter
34 | ERROR | [ ] Missing parameter comment
34 | ERROR | [ ] Missing parameter type
35 | ERROR | [x] Separate the @param and @return sections by a blank line.
35 | ERROR | [ ] Description for the @return value is missing
42 | ERROR | [x] Doc comment short description must start with a capital letter
44 | ERROR | [ ] Doc comment short description must end with a full stop
44 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
45 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
45 | ERROR | [ ] Description for the @return value is missing
52 | ERROR | [ ] Doc comment short description must start with a capital letter
55 | ERROR | [ ] Doc comment short description must end with a full stop
55 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
56 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
56 | ERROR | [ ] Missing parameter comment
56 | ERROR | [ ] Missing parameter type
67 | ERROR | [x] Doc comment short description must start with a capital letter
69 | ERROR | [ ] Missing parameter comment
70 | ERROR | [x] Separate the @param and @return sections by a blank line.
70 | ERROR | [ ] Description for the @return value is missing
79 | ERROR | [x] Doc comment short description must start with a capital letter
84 | ERROR | [ ] Doc comment short description must end with a full stop
84 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
86 | ERROR | [ ] Description for the @return value is missing
87 | ERROR | [x] Separate the @return and @throws sections by a blank line.
97 | ERROR | [x] Doc comment short description must start with a capital letter
99 | ERROR | [ ] Missing parameter comment
99 | ERROR | [ ] Missing parameter type
100 | ERROR | [ ] Missing parameter comment
100 | ERROR | [ ] Missing parameter type
101 | ERROR | [x] Separate the @param and @return sections by a blank line.
101 | ERROR | [ ] Description for the @return value is missing
104 | ERROR | [x] Opening brace should be on the same line as the declaration
106 | ERROR | [x] Short array syntax must be used to define arrays
108 | WARNING | [x] A comma should follow the last multiline array item. Found: $name
111 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
115 | ERROR | [x] Doc comment short description must start with a capital letter
117 | ERROR | [ ] Missing parameter comment
117 | ERROR | [ ] Missing parameter type
118 | ERROR | [x] Separate the @param and @return sections by a blank line.
118 | ERROR | [ ] Description for the @return value is missing
122 | ERROR | [x] Expected 1 blank line after function; 0 found
123 | ERROR | [x] The closing brace for the class must have an empty line before it
126 | ERROR | [x] Doc comment short description must start with a capital letter
127 | ERROR | [ ] Doc comment short description must end with a full stop
127 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
128 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
132 | ERROR | [ ] Missing short description in doc comment
133 | ERROR | [x] Data types in @var tags need to be fully namespaced
139 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
139 | ERROR | [ ] Missing parameter comment
139 | ERROR | [x] Data types in @param tags need to be fully namespaced
140 | ERROR | [ ] Missing parameter comment
140 | ERROR | [ ] Missing parameter type
147 | ERROR | [x] Doc comment short description must start with a capital letter
149 | ERROR | [ ] Missing parameter comment
149 | ERROR | [ ] Missing parameter type
150 | ERROR | [ ] Missing parameter comment
150 | ERROR | [ ] Missing parameter type
151 | ERROR | [x] Separate the @param and @return sections by a blank line.
151 | ERROR | [ ] Description for the @return value is missing
155 | ERROR | [x] Short array syntax must be used to define arrays
157 | WARNING | [x] A comma should follow the last multiline array item. Found: $name
160 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
164 | ERROR | [x] Doc comment short description must start with a capital letter
166 | ERROR | [ ] Missing parameter comment
166 | ERROR | [ ] Missing parameter type
167 | ERROR | [x] Separate the @param and @return sections by a blank line.
167 | ERROR | [ ] Description for the @return value is missing
176 | ERROR | [x] Missing function doc comment
184 | ERROR | [x] Doc comment short description must start with a capital letter
185 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
185 | ERROR | [ ] Description for the @return value is missing
193 | ERROR | [x] Doc comment short description must start with a capital letter
195 | ERROR | [ ] Missing parameter comment
196 | ERROR | [x] Separate the @param and @return sections by a blank line.
196 | ERROR | [ ] Description for the @return value is missing
196 | ERROR | [x] Data types in @return tags need to be fully namespaced
205 | ERROR | [ ] Missing short description in doc comment
206 | ERROR | [ ] Missing parameter comment
207 | ERROR | [ ] Description for the @return value is missing
207 | ERROR | [x] Data types in @return tags need to be fully namespaced
214 | ERROR | [x] Doc comment short description must start with a capital letter
216 | ERROR | [ ] Description for the @return value is missing
226 | ERROR | [x] Doc comment short description must start with a capital letter
228 | ERROR | [ ] Missing parameter comment
229 | ERROR | [x] Separate the @param and @return sections by a blank line.
229 | ERROR | [ ] Description for the @return value is missing
233 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
247 | ERROR | [x] Doc comment short description must start with a capital letter
249 | ERROR | [ ] Description for the @return value is missing
256 | ERROR | [x] Expected 1 blank line after function; 0 found
257 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 54 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\entity_expand\src\EntityExpandInterface.php
-----------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
4 | ERROR | [x] Missing interface doc comment
5 | ERROR | [x] Missing function doc comment
5 | ERROR | [x] Expected 1 blank line before function; 0 found
5 | ERROR | [x] Expected 1 blank line after function; 0 found
6 | ERROR | [x] The closing brace for the interface must have an empty line before it
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

Steps to reproduce

Run following command:

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml entity_expand/

Proposed resolution

Above error/warnings need to be fixed.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

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