Fix the issues reported by phpcs

Created on 6 July 2023, over 1 year ago
Updated 24 August 2023, over 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/events_list/events_list.routing.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
6 | WARNING | Open page callback found, please add a comment before the line
| | why there is no access restriction
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/events_list/README.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 8 WARNINGS AFFECTING 9 LINES
------------------------------------------------------------------------
45 | WARNING | [ ] Line exceeds 80 characters; contains 141 characters
55 | WARNING | [ ] Line exceeds 80 characters; contains 159 characters
56 | WARNING | [ ] Line exceeds 80 characters; contains 128 characters
57 | WARNING | [ ] Line exceeds 80 characters; contains 122 characters
58 | WARNING | [ ] Line exceeds 80 characters; contains 94 characters
59 | WARNING | [ ] Line exceeds 80 characters; contains 156 characters
60 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
62 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
78 | 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/events_list/css/list-published-events.css
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 10 LINES
--------------------------------------------------------------------------------
18 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
23 | ERROR | [x] CSS colours must be defined in lowercase; expected #d5d5d5
| | but found #D5D5D5
36 | ERROR | [x] CSS colours must be defined in lowercase; expected #d5d5d5
| | but found #D5D5D5
40 | ERROR | [x] Whitespace found at end of line
42 | ERROR | [x] Selectors must be on a single line
43 | ERROR | [x] Blank lines are not allowed between class names
43 | ERROR | [x] Expected 1 space before opening brace of class definition;
| | newline found
48 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
52 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
56 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
57 | ERROR | [x] CSS colours must be defined in lowercase; expected #d5d5d5
| | but found #D5D5D5
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/events_list/css/listevents.css
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 10 LINES
--------------------------------------------------------------------------------
18 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
23 | ERROR | [x] CSS colours must be defined in lowercase; expected #d5d5d5
| | but found #D5D5D5
36 | ERROR | [x] CSS colours must be defined in lowercase; expected #d5d5d5
| | but found #D5D5D5
40 | ERROR | [x] Whitespace found at end of line
42 | ERROR | [x] Selectors must be on a single line
43 | ERROR | [x] Blank lines are not allowed between class names
43 | ERROR | [x] Expected 1 space before opening brace of class definition;
| | newline found
48 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
52 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
56 | ERROR | [x] Expected 1 space before opening brace of class definition; 0
| | found
57 | ERROR | [x] CSS colours must be defined in lowercase; expected #d5d5d5
| | but found #D5D5D5
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/events_list/src/Controller/EventsController.php
--------------------------------------------------------------------------------
FOUND 52 ERRORS AND 5 WARNINGS AFFECTING 33 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
| | line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
| | with a file doc comment
4 | ERROR | [x] Doc comment short description must end with a full stop
16 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
33 | ERROR | [x] Expected 3 space(s) before asterisk; 4 found
34 | ERROR | [x] Expected 3 space(s) before asterisk; 4 found
35 | ERROR | [x] Expected 3 space(s) before asterisk; 4 found
36 | ERROR | [x] Expected 3 space(s) before asterisk; 4 found
37 | ERROR | [x] Expected 3 space(s) before asterisk; 4 found
38 | ERROR | [x] Expected 3 space(s) before asterisk; 4 found
39 | ERROR | [x] Expected 3 space(s) before asterisk; 4 found
62 | ERROR | [x] Expected one space after the comma, 0 found
65 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
78 | ERROR | [x] Expected 1 space after IF keyword; 0 found
78 | ERROR | [x] There should be no white space after an opening "("
83 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
83 | ERROR | [x] Expected 1 space before "=>"; 0 found
83 | ERROR | [x] Expected 1 space after "=>"; 0 found
84 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
84 | ERROR | [x] Expected 1 space before "=>"; 0 found
84 | ERROR | [x] Expected 1 space after "=>"; 0 found
85 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
85 | ERROR | [x] Expected 1 space before "=>"; 0 found
85 | ERROR | [x] Expected 1 space after "=>"; 0 found
86 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
86 | ERROR | [x] Expected 1 space before "=>"; 0 found
86 | ERROR | [x] Expected 1 space after "=>"; 0 found
87 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
87 | ERROR | [x] Expected 1 space before "=>"; 0 found
87 | ERROR | [x] Expected 1 space after "=>"; 0 found
88 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
88 | ERROR | [x] Expected 1 space before "=>"; 0 found
88 | ERROR | [x] Expected 1 space after "=>"; 0 found
89 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
89 | ERROR | [x] Expected 1 space before "=>"; 0 found
89 | ERROR | [x] Expected 1 space after "=>"; 0 found
90 | ERROR | [x] Array indentation error, expected 8 spaces but found 6
90 | ERROR | [x] Expected 1 space before "=>"; 0 found
90 | ERROR | [x] Expected 1 space after "=>"; 0 found
95 | ERROR | [x] Expected 1 space before "=>"; 0 found
95 | ERROR | [x] Expected 1 space after "=>"; 0 found
96 | ERROR | [x] Expected 1 space before "=>"; 0 found
96 | ERROR | [x] Expected 1 space after "=>"; 0 found
97 | ERROR | [x] Expected 1 space before "=>"; 0 found
97 | ERROR | [x] Expected 1 space after "=>"; 0 found
98 | ERROR | [x] Expected 1 space before "=>"; 0 found
98 | ERROR | [x] Expected 1 space after "=>"; 0 found
98 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 0
100 | ERROR | [x] Expected 1 space before "=>"; 0 found
100 | ERROR | [x] Expected 1 space after "=>"; 0 found
101 | ERROR | [x] Expected 1 space before "=>"; 0 found
101 | ERROR | [x] Expected 1 space after "=>"; 0 found
102 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 'events_list/events_list.list_published_events'
103 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ]
104 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ]
110 | ERROR | [x] Expected 1 blank line after function; 0 found
111 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 56 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...w/html/vb/d_cont/events_list/src/Plugin/Block/ListPublishedEventsBlock.php
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------
9 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
10 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
11 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
12 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
13 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
14 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
15 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
22 | ERROR | [x] Calling class constructors must always include parentheses
25 | ERROR | [x] Expected 1 blank line after function; 0 found
26 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/events_list/src/Plugin/Block/ListEventsBlock.php
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------
9 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
10 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
11 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
12 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
13 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
14 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
15 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
22 | ERROR | [x] Calling class constructors must always include parentheses
25 | ERROR | [x] Expected 1 blank line after function; 0 found
26 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/events_list/events_list.module
------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 8 LINES
------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] Missing file doc comment
20 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
20 | ERROR | [x] Missing function doc comment
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
22 | ERROR | [x] Expected 1 space before "=>"; 0 found
22 | ERROR | [x] Expected 1 space after "=>"; 0 found
23 | ERROR | [x] Expected 1 space before "=>"; 0 found
23 | ERROR | [x] Expected 1 space after "=>"; 0 found
24 | ERROR | [x] Expected 1 space before "=>"; 0 found
24 | ERROR | [x] Expected 1 space after "=>"; 0 found
28 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
29 | ERROR | [x] Expected 1 newline at end of file; 0 found
29 | ERROR | [x] Whitespace found at end of line
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

Time: 131ms; 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 events_list/

Remaining tasks

Patch review

📌 Task
Status

RTBC

Version

1.3

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
  • Status changed to RTBC over 1 year ago
  • Hi @urvashi_vora, thanks for the patch, I have review your patch.

    These are the steps I followed:

    1. Took clone from git version 1.3.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/events_list/

    3. Applied patch and again ran phpcs command.

    found no errors.

    Moving this to RTBC.

Production build 0.71.5 2024