Fix the issues reported by phpcs

Created on 3 July 2023, 12 months ago

Problem/Motivation

FILE: ...r/www/html/vb/d_cont/scroll_to_top_button/scroll_to_top_button.routing.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
7 | WARNING | [ ] The administration page callback should probably use
| | "administer site configuration" - which implies the user can
| | change something - rather than "access administration pages"
| | which is about viewing but not changing configurations.
7 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/scroll_to_top_button/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
4 | WARNING | Line exceeds 80 characters; contains 127 characters
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/scroll_to_top_button/assets/css/scroll_to_top.css
-------------------------------------------------------------------------------
FOUND 44 ERRORS AFFECTING 44 LINES
-------------------------------------------------------------------------------
2 | ERROR | [x] Whitespace found at end of line
5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
11 | ERROR | [x] Multiple selectors should each be on a single line
12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
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
20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
23 | ERROR | [x] Blank lines are not allowed in class definitions
26 | ERROR | [x] Multiple selectors should each be on a single line
27 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
31 | ERROR | [x] Multiple selectors should each be on a single line
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
36 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
38 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
39 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
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
45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
49 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
52 | ERROR | [x] Multiple selectors should each be on a single line
53 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
54 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
58 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
59 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 44 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/scroll_to_top_button/scroll_to_top_button.module
--------------------------------------------------------------------------------
FOUND 51 ERRORS AND 3 WARNINGS AFFECTING 42 LINES
--------------------------------------------------------------------------------
4 | ERROR | [x] The second line in the file doc comment must be "@file"
4 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements
| | hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "*
| | Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or
| | "* Implements hook_foo_BAR_ID_bar() for block templates."
5 | ERROR | [x] There must be no blank lines after the function comment
8 | ERROR | [x] Opening brace should be on the same line as the declaration
10 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
13 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
17 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
19 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
19 | ERROR | [x] No space found before comment text; expected "// building
| | the css style" but found "//building the css style"
19 | ERROR | [x] Inline comments must start with a capital letter
19 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
20 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
22 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
22 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
23 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
24 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
25 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
27 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
28 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
31 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
32 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
35 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
36 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
37 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
38 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
38 | ERROR | [x] Expected newline after closing brace
39 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
42 | ERROR | [x] Inline comments must start with a capital letter
42 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
43 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
45 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
47 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
47 | ERROR | [x] Inline comments must start with a capital letter
47 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
48 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
49 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
50 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
52 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
54 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
55 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
57 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | 'css'
59 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
59 | WARNING | [ ] Only string literals should be passed to t() where possible
61 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
62 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 52 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/scroll_to_top_button/src/form/ScrollForm.php
--------------------------------------------------------------------------------
FOUND 103 ERRORS AND 2 WARNINGS AFFECTING 89 LINES
--------------------------------------------------------------------------------
6 | ERROR | [x] There must be one blank line after the last USE statement;
| | 2 found;
9 | ERROR | [x] Missing class doc comment
10 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
14 | ERROR | [x] Expected 1 blank line before function; 0 found
15 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
16 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
23 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
24 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
25 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 'scroll_to_top_button.ScrollToTop_Form'
27 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
32 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
33 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
34 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
35 | ERROR | [x] Short array syntax must be used to define arrays
36 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
37 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
38 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
39 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
40 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
43 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
43 | ERROR | [x] Short array syntax must be used to define arrays
44 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
45 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
46 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
47 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
47 | ERROR | [x] Short array syntax must be used to define arrays
48 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
49 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
50 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
52 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
55 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
55 | ERROR | [x] Short array syntax must be used to define arrays
56 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
57 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
58 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
59 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
62 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
62 | ERROR | [x] Short array syntax must be used to define arrays
63 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
64 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
65 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
66 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
68 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
68 | ERROR | [x] Short array syntax must be used to define arrays
69 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
70 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
71 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
72 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
74 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
76 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
76 | ERROR | [x] Short array syntax must be used to define arrays
77 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
78 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
79 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
80 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
81 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
84 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
84 | ERROR | [x] Short array syntax must be used to define arrays
85 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
86 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
87 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
88 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
88 | WARNING | [ ] Translatable strings must not begin or end with white
| | spaces, use placeholders with t() for variables
89 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
92 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
92 | ERROR | [x] Short array syntax must be used to define arrays
93 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
94 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
95 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
96 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
97 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
100 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
100 | ERROR | [x] Short array syntax must be used to define arrays
101 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
102 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
103 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
104 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
106 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
106 | ERROR | [x] Short array syntax must be used to define arrays
107 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
108 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
109 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
110 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
112 | ERROR | [x] Whitespace found at end of line
112 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
114 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
116 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
116 | ERROR | [x] Expected 1 blank line after function; 2 found
119 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
122 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
123 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
125 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
126 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
128 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
129 | ERROR | [x] Object operator not indented correctly; expected 10 spaces
| | but found 12
140 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
141 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
141 | ERROR | [x] Expected 1 blank line after function; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 104 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

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

FILE: ...w/html/vb/d_cont/scroll_to_top_button/scroll_to_top_button.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: 173ms; 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 scroll_to_top_button/

Remaining tasks

Patch review

๐Ÿ“Œ Task
Status

RTBC

Version

2.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
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Anjali Mehta

    Anjali Mehta โ†’ made their first commit to this issueโ€™s fork.

  • @anjali-mehta opened merge request.
  • @anjali-mehta opened merge request.
  • Status changed to RTBC 12 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi,

    I reviewed the changes and confirmed the patch was applied cleanly.

    Checking patch README.md...
    Checking patch assets/css/scroll_to_top.css...
    Checking patch scroll_to_top_button.info.yml...
    Checking patch scroll_to_top_button.module...
    Checking patch scroll_to_top_button.permissions.yml...
    Checking patch scroll_to_top_button.routing.yml...
    Checking patch src/form/ScrollForm.php...
    Applied patch README.md cleanly.
    Applied patch assets/css/scroll_to_top.css cleanly.
    Applied patch scroll_to_top_button.info.yml cleanly.
    Applied patch scroll_to_top_button.module cleanly.
    Applied patch scroll_to_top_button.permissions.yml cleanly.
    Applied patch scroll_to_top_button.routing.yml cleanly.
    Applied patch src/form/ScrollForm.php cleanly.

    All PHPCS errors have been fixed.

    I executed this command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig scroll_to_top_button/

    Applied to Scroll To Top Button Page module with 2.0.x-dev version and with the Drupal core version of 9.5.x.

    Attaching screenshots.

    I'm moving this now to RTBC.

    Thanks!

Production build 0.69.0 2024