Fix the issues reported by phpcs

Created on 25 January 2023, almost 2 years ago
Updated 17 May 2023, over 1 year ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal gdpr_alert

FILE: C:\Users\Admin\Desktop\task\gdpr_alert\css\gdpr_alert.css
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\gdpr_alert\js\gdpr_alert.js
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\gdpr_alert\src\Form\GDPRAlertConfigForm.php
--------------------------------------------------------------------------------
FOUND 18 ERRORS AND 2 WARNINGS AFFECTING 20 LINES
--------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
     |         |     "\r\n"
  15 | ERROR   | [x] Doc comment short description must end with a full stop
  18 | WARNING | [ ] The class short comment should describe what the class
     |         |     does and not simply repeat the class name
  21 | ERROR   | [ ] Missing short description in doc comment
  26 | ERROR   | [ ] Missing short description in doc comment
  31 | ERROR   | [ ] Missing short description in doc comment
  39 | ERROR   | [ ] Missing parameter comment
  40 | ERROR   | [ ] Missing parameter comment
  41 | ERROR   | [ ] Missing parameter comment
  54 | ERROR   | [ ] Missing short description in doc comment
  55 | ERROR   | [ ] Missing parameter comment
  68 | ERROR   | [ ] Doc comment short description must start with a capital
     |         |     letter
  84 | ERROR   | [ ] Description for the @return value is missing
 102 | ERROR   | [ ] Missing parameter comment
 165 | WARNING | [ ] Possible useless method overriding detected
 177 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
 180 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
 189 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
 191 | ERROR   | [x] Expected 1 blank line after function; 0 found
 192 | ERROR   | [x] The closing brace for the class must have an empty line
     |         |     before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\gdpr_alert\src\Form\GDPRAlertSettingsForm.php
--------------------------------------------------------------------------------
FOUND 18 ERRORS AND 2 WARNINGS AFFECTING 20 LINES
--------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
     |         |     "\r\n"
  14 | ERROR   | [x] Doc comment short description must end with a full stop
  17 | WARNING | [ ] The class short comment should describe what the class
     |         |     does and not simply repeat the class name
  20 | ERROR   | [ ] Missing short description in doc comment
  25 | ERROR   | [ ] Missing short description in doc comment
  33 | ERROR   | [ ] Missing parameter comment
  34 | ERROR   | [ ] Missing parameter comment
  35 | ERROR   | [ ] Missing parameter comment
  39 | ERROR   | [x] Expected 1 space between type hint and argument
     |         |     "$cache_factory"; 2 found
  40 | ERROR   | [x] Expected 1 space between type hint and argument "$state";
     |         |     9 found
  47 | ERROR   | [ ] Missing short description in doc comment
  48 | ERROR   | [ ] Missing parameter comment
  61 | ERROR   | [ ] Doc comment short description must start with a capital
     |         |     letter
  77 | ERROR   | [ ] Description for the @return value is missing
  92 | ERROR   | [ ] Missing parameter comment
 156 | WARNING | [ ] Possible useless method overriding detected
 167 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
 174 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
 176 | ERROR   | [x] Expected 1 blank line after function; 0 found
 177 | ERROR   | [x] The closing brace for the class must have an empty line
     |         |     before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\gdpr_alert\src\Plugin\Block\GDPRAlertBlock.php
--------------------------------------------------------------------------------
FOUND 21 ERRORS AFFECTING 18 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  15 | ERROR | [x] Doc comment short description must end with a full stop
  25 | ERROR | [ ] Missing short description in doc comment
  30 | ERROR | [ ] Missing short description in doc comment
  35 | ERROR | [ ] Missing short description in doc comment
  41 | ERROR | [x] Doc comment short description must end with a full stop
  47 | ERROR | [ ] Missing short description in doc comment
  55 | ERROR | [ ] Missing parameter comment
  56 | ERROR | [ ] Missing parameter comment
  56 | ERROR | [ ] Missing parameter type
  57 | ERROR | [ ] Missing parameter comment
  57 | ERROR | [ ] Missing parameter type
  58 | ERROR | [ ] Missing parameter comment
  59 | ERROR | [ ] Missing parameter comment
  60 | ERROR | [ ] Missing parameter comment
  61 | ERROR | [ ] Missing parameter comment
  98 | ERROR | [ ] Description for the @return value is missing
 131 | ERROR | [x] Concat operator must be surrounded by a single space
 131 | ERROR | [x] Concat operator must be surrounded by a single space
 159 | ERROR | [x] Expected 1 blank line after function; 0 found
 160 | ERROR | [x] The closing brace for the class must have an empty line
     |       |     before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 494ms; Memory: 8MB

Proposed resolution

Fix the errors and warnings.

๐Ÿ“Œ Task
Status

Needs work

Version

1.0

Component

Documentation

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Jay Jangid

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