Fix the issues reported by phpcs

Created on 4 July 2023, over 1 year ago
Updated 2 January 2024, 11 months ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/jira_updates_reporter/README.txt
-----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------
11 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
28 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------

FILE: ...ar/www/html/vb/d_cont/jira_updates_reporter/jira_updates_reporter.info.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
8 | WARNING | [ ] All dependencies must be prefixed with the project name, for
| | example "drupal:"
8 | 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/d_cont/jira_updates_reporter/src/Form/ConfigForm.php
--------------------------------------------------------------------------------
FOUND 26 ERRORS AND 5 WARNINGS AFFECTING 31 LINES
--------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
10 | ERROR | [x] There must be one blank line after the last USE statement;
| | 2 found;
15 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
17 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
30 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
38 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
42 | ERROR | [x] Expected 1 blank line after function; 2 found
49 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
59 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
67 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
73 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
76 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
86 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
95 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
105 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
110 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
113 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
123 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
133 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
143 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
160 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
180 | WARNING | [ ] Possible useless method overriding detected
181 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
189 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
192 | ERROR | [x] Short array syntax must be used to define arrays
196 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: "last_check"
204 | ERROR | [x] Expected 1 blank line after function; 2 found
207 | ERROR | [x] Missing function doc comment
208 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
210 | ERROR | [x] Expected 1 blank line after function; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 29 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/jira_updates_reporter/src/JiraWrapperService.php
--------------------------------------------------------------------------------
FOUND 141 ERRORS AND 4 WARNINGS AFFECTING 121 LINES
--------------------------------------------------------------------------------
7 | ERROR | [x] There must be one blank line after the last USE statement;
| | 3 found;
10 | ERROR | [ ] More than 2 empty lines are not allowed
15 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
17 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
21 | ERROR | [ ] Missing short description in doc comment
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
45 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
46 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
49 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
52 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
53 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
54 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
55 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
57 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
57 | ERROR | [x] Expected 1 blank line after function; 2 found
60 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
69 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
70 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
71 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
72 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
73 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
74 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
75 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
76 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
77 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
78 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
79 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
79 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
80 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
81 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
81 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
82 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
83 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
85 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
86 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
87 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
87 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
88 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
89 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
90 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
90 | ERROR | [x] Expected newline after closing brace
91 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
92 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
92 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
93 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
94 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
95 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
96 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
97 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
99 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
108 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
108 | ERROR | [ ] Type hint "array" missing for $data
109 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
110 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
111 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
112 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
113 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
114 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
115 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
116 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
117 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
117 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
118 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
119 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
119 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
120 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
121 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
122 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
123 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
124 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
124 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
125 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
126 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
126 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
127 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
127 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
127 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
127 | WARNING | [ ] Translatable strings must not begin or end with white
| | spaces, use placeholders with t() for variables
127 | ERROR | [ ] Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
128 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
129 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
129 | ERROR | [x] Expected newline after closing brace
130 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
131 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
131 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
132 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
133 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
134 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
134 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE"
| | but found "false"
135 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
136 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
138 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
141 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
142 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
143 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
144 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
146 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
147 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
149 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
150 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
152 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
153 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
154 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
156 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
157 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
162 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 20
163 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 20
164 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
165 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
167 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
168 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 28
169 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 28
170 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
171 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
172 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 28
173 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 28
174 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
175 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
176 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
177 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
178 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 28
178 | ERROR | [x] Short array syntax must be used to define arrays
179 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
179 | ERROR | [x] Short array syntax must be used to define arrays
180 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
180 | ERROR | [x] Short array syntax must be used to define arrays
181 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
182 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
183 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
183 | ERROR | [x] Short array syntax must be used to define arrays
186 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 28
187 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 24
188 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 20
189 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
190 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
191 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
192 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
192 | ERROR | [x] Expected 1 blank line after function; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 137 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/jira_updates_reporter/jira_updates_reporter.module
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
14 | ERROR | [x] Opening brace should be on the same line as the declaration
16 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
27 | ERROR | [x] Missing function doc comment
28 | ERROR | [x] Opening brace should be on the same line as the declaration
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...html/vb/d_cont/jira_updates_reporter/jira_updates_reporter.permissions.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
3 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 171ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig jira_updates_reporter/

Remaining tasks

Patch review

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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

  • Issue created by @urvashi_vora
  • Hii, @urvashi_vora thanks for the patch,

    These are the steps I followed:

    1. Took clone from git version 1.0.x in drupal 10.1.x

    2. Ran this command:

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig modules/contrib/required_content/

    3. Applied your patch and, again ran phpcs command

    found errors.

    4. Fixed the errors and provide the patch.

    Please Review.

  • Status changed to RTBC 11 months ago
  • 🇮🇳India Ashutosh Ahirwal India

    I have applied provided patch of #2 and it get applied cleanly and no errors and warnings found.
    moving to RTBC.

Production build 0.71.5 2024