Fix the issues reported by phpcs

Created on 5 July 2023, over 1 year ago
Updated 29 September 2023, about 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/secure_admin_path/secure_admin_path.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/secure_admin_path/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------
24 | WARNING | Line exceeds 80 characters; contains 136 characters
25 | WARNING | Line exceeds 80 characters; contains 109 characters
36 | WARNING | Line exceeds 80 characters; contains 375 characters
38 | WARNING | Line exceeds 80 characters; contains 468 characters
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/secure_admin_path/secure_admin_path.module
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 3 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
10 | WARNING | [ ] Hook implementations should not duplicate @param
| | documentation
10 | ERROR | [ ] Missing parameter comment
11 | WARNING | [ ] Hook implementations should not duplicate @param
| | documentation
11 | ERROR | [ ] Missing parameter comment
11 | ERROR | [x] Data types in @param tags need to be fully namespaced
13 | WARNING | [ ] Hook implementations should not duplicate @return
| | documentation
13 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../html/vb/d_cont/secure_admin_path/src/Form/SecureAdminPathSettingsForm.php
--------------------------------------------------------------------------------
FOUND 32 ERRORS AFFECTING 23 LINES
--------------------------------------------------------------------------------
14 | ERROR | [x] Missing class doc comment
18 | ERROR | [ ] Missing short description in doc comment
19 | ERROR | [x] Data types in @var tags need to be fully namespaced
23 | ERROR | [ ] Missing short description in doc comment
24 | ERROR | [x] Data types in @var tags need to be fully namespaced
29 | ERROR | [ ] Doc comment short description must start with a capital
| | letter
44 | ERROR | [ ] Missing short description in doc comment
45 | ERROR | [ ] Missing parameter comment
45 | ERROR | [x] Data types in @param tags need to be fully namespaced
46 | ERROR | [ ] Missing parameter comment
46 | ERROR | [x] Data types in @param tags need to be fully namespaced
47 | ERROR | [ ] Missing parameter comment
47 | ERROR | [x] Data types in @param tags need to be fully namespaced
59 | ERROR | [ ] Missing short description in doc comment
60 | ERROR | [ ] Missing parameter comment
60 | ERROR | [x] Data types in @param tags need to be fully namespaced
73 | ERROR | [ ] Doc comment short description must start with a capital
| | letter
130 | ERROR | [ ] Missing parameter comment
131 | ERROR | [ ] Missing parameter comment
131 | ERROR | [x] Data types in @param tags need to be fully namespaced
133 | ERROR | [ ] Type hint "array" missing for $element
165 | ERROR | [x] Inline comments must start with a capital letter
165 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
168 | ERROR | [x] Inline comments must start with a capital letter
168 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
171 | ERROR | [x] Inline comments must start with a capital letter
171 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
175 | ERROR | [ ] Missing short description in doc comment
176 | ERROR | [ ] Missing parameter comment
176 | ERROR | [x] Data types in @param tags need to be fully namespaced
190 | ERROR | [x] Expected 1 blank line after function; 0 found
191 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...www/html/vb/d_cont/secure_admin_path/src/Form/SecureAdminPathValidator.php
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 9 LINES
--------------------------------------------------------------------------------
7 | ERROR | [x] Missing class doc comment
11 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
13 | ERROR | [ ] Missing parameter comment
15 | ERROR | [x] Expected "bool" but found "boolean" for function return type
15 | ERROR | [ ] Description for the @return value is missing
23 | ERROR | [x] Doc comment short description must end with a full stop
23 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
25 | ERROR | [ ] Missing parameter comment
27 | ERROR | [ ] Description for the @return value is missing
34 | ERROR | [x] Expected 1 blank line after function; 0 found
35 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...t/secure_admin_path/src/EventSubscriber/SecureAdminPathEventSubscriber.php
--------------------------------------------------------------------------------
FOUND 33 ERRORS AFFECTING 25 LINES
--------------------------------------------------------------------------------
12 | ERROR | [x] Missing class doc comment
15 | ERROR | [x] Doc comment short description must start with a capital
| | letter
21 | ERROR | [ ] Missing short description in doc comment
22 | ERROR | [x] Data types in @var tags need to be fully namespaced
26 | ERROR | [ ] Missing short description in doc comment
27 | ERROR | [ ] Missing parameter comment
27 | ERROR | [x] Data types in @param tags need to be fully namespaced
36 | ERROR | [x] Doc comment short description must end with a full stop
36 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
38 | ERROR | [ ] Description for the @return value is missing
48 | ERROR | [ ] Missing short description in doc comment
49 | ERROR | [ ] Missing parameter comment
49 | ERROR | [x] Data types in @param tags need to be fully namespaced
49 | ERROR | [x] Data types in @param tags need to be fully namespaced
63 | ERROR | [ ] Missing short description in doc comment
64 | ERROR | [ ] Missing parameter comment
64 | ERROR | [x] Data types in @param tags need to be fully namespaced
64 | ERROR | [x] Data types in @param tags need to be fully namespaced
65 | ERROR | [ ] Missing parameter comment
66 | ERROR | [ ] Missing parameter comment
78 | ERROR | [ ] Missing short description in doc comment
79 | ERROR | [ ] Missing parameter comment
79 | ERROR | [x] Data types in @param tags need to be fully namespaced
80 | ERROR | [ ] Missing parameter comment
81 | ERROR | [ ] Missing parameter comment
100 | ERROR | [ ] Missing short description in doc comment
101 | ERROR | [ ] Missing parameter comment
101 | ERROR | [x] Data types in @param tags need to be fully namespaced
102 | ERROR | [ ] Missing parameter comment
104 | ERROR | [x] Expected "bool" but found "boolean" for function return type
106 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
113 | ERROR | [x] Expected 1 blank line after function; 0 found
114 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/secure_admin_path/src/Config.php
--------------------------------------------------------------------------------
FOUND 31 ERRORS AFFECTING 28 LINES
--------------------------------------------------------------------------------
10 | ERROR | [x] Doc comment short description must end with a full stop
19 | ERROR | [ ] Missing short description in doc comment
20 | ERROR | [x] Data types in @var tags need to be fully namespaced
24 | ERROR | [ ] Missing short description in doc comment
25 | ERROR | [x] Data types in @var tags need to be fully namespaced
29 | ERROR | [ ] Missing short description in doc comment
30 | ERROR | [x] Data types in @var tags need to be fully namespaced
34 | ERROR | [ ] Missing short description in doc comment
35 | ERROR | [ ] Missing parameter comment
35 | ERROR | [x] Data types in @param tags need to be fully namespaced
41 | ERROR | [ ] Missing short description in doc comment
42 | ERROR | [ ] Description for the @return value is missing
42 | ERROR | [x] Data types in @return tags need to be fully namespaced
54 | ERROR | [ ] Missing short description in doc comment
55 | ERROR | [ ] Description for the @return value is missing
55 | ERROR | [x] Data types in @return tags need to be fully namespaced
65 | ERROR | [ ] Missing short description in doc comment
66 | ERROR | [ ] Missing parameter comment
68 | ERROR | [ ] Description for the @return value is missing
74 | ERROR | [ ] Missing short description in doc comment
75 | ERROR | [ ] Missing parameter comment
77 | ERROR | [ ] Description for the @return value is missing
83 | ERROR | [ ] Missing short description in doc comment
84 | ERROR | [ ] Missing parameter comment
85 | ERROR | [ ] Missing parameter comment
91 | ERROR | [ ] Missing short description in doc comment
92 | ERROR | [ ] Missing parameter comment
93 | ERROR | [ ] Missing parameter comment
99 | ERROR | [x] Missing function doc comment
101 | ERROR | [x] Expected 1 blank line after function; 0 found
102 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 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 secure_admin_path/\

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
    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/secure_admin_path/

    3. Applied your patch and, again ran phpcs command

    found errors.

    4. Create a patch and fixed the errors.

    Please Review.

  • Status changed to RTBC about 1 year ago
  • 🇮🇳India aayushDrupal

    Hi Satish_kumar,
    Your patch has been successfully applied with no remaining errors. Please check the attached screenshot.

    Moving to RTBC.
    Thanks

Production build 0.71.5 2024