Fix the issues reported by phpcs

Created on 4 July 2023, over 1 year ago
Updated 4 June 2024, 6 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/lb_branch_hours_blocks/

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/lb_branch_hours_blocks/src/HoursToday.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------
33 | ERROR | [ ] Parameter $branch_hours_helper is not described in comment
38 | ERROR | [ ] Doc comment for parameter $branchHoursHelper does not match actual variable name $branch_hours_helper
61 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
83 | ERROR | [x] Concat operator must be surrounded by a single space
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/lb_branch_hours_blocks/src/Plugin/Block/BranchHoursBlock.php
-----------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
-----------------------------------------------------------------------------------------------------------------
40 | ERROR | [x] Doc comment short description must end with a full stop
94 | ERROR | [x] Expected 1 space after "="; 2 found
105 | ERROR | [x] Expected 1 space after IF keyword; 0 found
113 | ERROR | [x] Use "elseif" in place of "else if"
117 | ERROR | [x] Use "elseif" in place of "else if"
160 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
164 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
193 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
194 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
203 | ERROR | [ ] Description for the @return value is missing
218 | ERROR | [ ] Description for the @return value is missing
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/lb_branch_hours_blocks/lb_branch_hours_blocks.module
---------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 2 WARNINGS AFFECTING 10 LINES
---------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
8 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
11 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
12 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
13 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
14 | ERROR | [x] Expected 1 blank line before function; 2 found
21 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
21 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 5
21 | ERROR | [x] Concat operator must be surrounded by a single space
24 | ERROR | [x] Expected 1 blank line after function; 2 found
30 | ERROR | [x] Expected 0 spaces after opening parenthesis; 1 found
30 | ERROR | [x] There should be no white space after an opening "("
30 | ERROR | [x] There should be no white space before a closing ")"
30 | ERROR | [x] Expected 0 spaces before closing parenthesis; 1 found
33 | WARNING | [x] A comma should follow the last multiline array item. Found: 'block'
34 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/lb_branch_hours_blocks/lb_branch_hours_blocks.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
-------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/lb_branch_hours_blocks/assets/css/branch-hours.css
-------------------------------------------------------------------------------------------------------
FOUND 182 ERRORS AFFECTING 140 LINES
-------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Closing brace of class definition must be on new line
4 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
5 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
6 | ERROR | [x] Closing brace of class definition must be on new line
7 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
9 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
10 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
10 | ERROR | [x] Closing brace of class definition must be on new line
11 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
12 | ERROR | [x] Closing brace of class definition must be on new line
13 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
14 | ERROR | [x] Closing brace of class definition must be on new line
15 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
19 | ERROR | [x] Closing brace of class definition must be on new line
20 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
22 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
23 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
24 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
24 | ERROR | [x] Closing brace of class definition must be on new line
25 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
27 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
32 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
35 | ERROR | [x] Closing brace of class definition must be on new line
36 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
38 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
38 | ERROR | [x] Closing brace of class definition must be on new line
39 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
40 | ERROR | [x] Closing brace of class definition must be on new line
41 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
42 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
43 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
44 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
44 | ERROR | [x] CSS colours must be defined in lowercase; expected #231f203f but found #231F203F
45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
46 | ERROR | [x] Closing brace of class definition must be on new line
47 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
49 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
50 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
50 | ERROR | [x] Closing brace of class definition must be on new line
51 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
52 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
53 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
54 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
55 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
55 | ERROR | [x] Closing brace of class definition must be on new line
56 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
57 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
58 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
58 | ERROR | [x] Closing brace of class definition must be on new line
59 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
60 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
61 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
62 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 11
62 | ERROR | [x] Closing brace of class definition must be on new line
63 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
64 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
64 | ERROR | [x] Closing brace of class definition must be on new line
65 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
65 | ERROR | [x] Multiple selectors should each be on a single line
66 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
66 | ERROR | [x] Closing brace of class definition must be on new line
67 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
68 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
68 | ERROR | [x] Closing brace of class definition must be on new line
69 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
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 6
72 | ERROR | [x] Closing brace of class definition must be on new line
73 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
74 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
75 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
75 | ERROR | [x] Closing brace of class definition must be on new line
76 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
77 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
78 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
78 | ERROR | [x] Closing brace of class definition must be on new line
79 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 8
80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
81 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 12
81 | ERROR | [x] Closing brace of class definition must be on new line
82 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
83 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
84 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
85 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
86 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
87 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
88 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
89 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
89 | ERROR | [x] CSS colours must be defined in lowercase; expected #2f2f2f but found #2F2F2F
90 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
91 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
92 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
93 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
93 | ERROR | [x] Closing brace of class definition must be on new line
94 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
95 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
96 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
96 | ERROR | [x] Closing brace of class definition must be on new line
97 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
98 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
98 | ERROR | [x] Closing brace of class definition must be on new line
99 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
100 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
101 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
102 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
103 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
103 | ERROR | [x] Closing brace of class definition must be on new line
104 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
105 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
106 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
106 | ERROR | [x] Closing brace of class definition must be on new line
107 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
108 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
108 | ERROR | [x] Closing brace of class definition must be on new line
109 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
110 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
111 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
111 | ERROR | [x] CSS colours must be defined in lowercase; expected #d8d8d8 but found #D8D8D8
111 | ERROR | [x] Closing brace of class definition must be on new line
112 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
113 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
114 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
114 | ERROR | [x] CSS colours must be defined in lowercase; expected #d8d8d8 but found #D8D8D8
114 | ERROR | [x] Closing brace of class definition must be on new line
115 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
116 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
116 | ERROR | [x] Closing brace of class definition must be on new line
117 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 6
118 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
119 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
119 | ERROR | [x] CSS colours must be defined in lowercase; expected #0060af but found #0060AF
120 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
121 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
122 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
123 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
124 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
124 | ERROR | [x] Closing brace of class definition must be on new line
125 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 8
126 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
127 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
127 | ERROR | [x] CSS colours must be defined in lowercase; expected #0060af but found #0060AF
128 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 10
128 | ERROR | [x] Closing brace of class definition must be on new line
129 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
130 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
131 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
132 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
132 | ERROR | [x] CSS colours must be defined in lowercase; expected #e9e9e9 but found #E9E9E9
133 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
134 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
135 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
136 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
136 | ERROR | [x] Closing brace of class definition must be on new line
139 | ERROR | [x] Closing brace of class definition must be on new line
142 | ERROR | [x] Closing brace of class definition must be on new line
143 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
144 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
145 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
145 | ERROR | [x] Closing brace of class definition must be on new line
147 | ERROR | [x] Expected 1 newline at end of file; 0 found

Steps to reproduce
Run the command 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/lb_branch_hours_blocks/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Needs review

Version

1.2

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia indrapatil 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

Merge Requests

Comments & Activities

Production build 0.71.5 2024