Fix the issues reported by PHPCS

Created on 12 April 2023, over 1 year ago
Updated 20 April 2023, over 1 year ago

Problem/Motivation

FILE: .../site_audit_server/src/Plugin/rest/resource/SiteAuditRemoteApiResource.php
--------------------------------------------------------------------------------
FOUND 11 ERRORS AND 6 WARNINGS AFFECTING 17 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
12 | WARNING | [x] Unused use statement
54 | WARNING | [ ] Possible useless method overriding detected
61 | ERROR | [x] There should be no white space before a closing ")"
91 | ERROR | [x] Expected one space after the comma, 0 found
99 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
102 | ERROR | [x] Expected 1 space after "="; 2 found
104 | ERROR | [x] Space after closing parenthesis of function call
| | prohibited
105 | ERROR | [x] Space found before semicolon; expected ");" but found ")\n
| | ;"
107 | ERROR | [x] Expected 1 space after "="; 2 found
116 | ERROR | [x] Perl-style comments are not allowed; use "// Comment"
| | instead
144 | ERROR | [ ] @return doc comment specified, but function has no return
| | statement
148 | ERROR | [x] Perl-style comments are not allowed; use "// Comment"
| | instead
150 | ERROR | [x] Expected 1 blank line after function; 0 found
151 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...n/drupal10/web/modules/contrib/site_audit_server/src/Form/SettingsForm.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
42 | WARNING | [ ] Possible useless method overriding detected
43 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
43 | ERROR | [x] 4 spaces found before inline comment; expected "// if
| | ($form_state->getValue('allowed_clients') !=
| | 'allowed_clients') {" but found "// if
| | ($form_state->getValue('allowed_clients') !=
| | 'allowed_clients') {"
43 | ERROR | [x] Inline comments must start with a capital letter
44 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
44 | ERROR | [ ] Comment indentation error, expected only 4 spaces
45 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
45 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../drupal10/web/modules/contrib/site_audit_server/site_audit_server.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
8 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
9 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
10 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
--------------------------------------------------------------------------------

Time: 333ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Fix all the issues for Drupal and Drupal Practice coding standards

Remaining tasks

Patch review

📌 Task
Status

RTBC

Version

4.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

Production build 0.71.5 2024