Fix the issues reported by phpcs

Created on 10 February 2023, almost 2 years ago
Updated 27 February 2023, over 1 year ago

Problem/Motivation

FILE: /Users/kushagra.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/cool_message/cool_message.module
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 4 WARNINGS AFFECTING 14 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
   5 | ERROR   | [x] Doc comment short description must start with a capital letter
   6 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
  26 | ERROR   | [x] Short array syntax must be used to define arrays
  27 | ERROR   | [x] Short array syntax must be used to define arrays
  28 | ERROR   | [x] Short array syntax must be used to define arrays
  28 | ERROR   | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
  41 | ERROR   | [x] Doc comment long description must end with a full stop
  46 | ERROR   | [x] Short array syntax must be used to define arrays
  56 | ERROR   | [x] Whitespace found at end of line
  72 | WARNING | [x] There must be no blank line following an inline comment
  72 | WARNING | [ ] There must be no blank line following an inline comment
  72 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 0
  72 | ERROR   | [x] 2 spaces found before inline comment; expected "// kint($variables);" but found "//  kint($variables);"
  77 | ERROR   | [x] Whitespace found at end of line
 114 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 124 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 125 | WARNING | [x] A comma should follow the last multiline array item. Found: $messages
 127 | ERROR   | [x] Whitespace found at end of line
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/kushagra.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/cool_message/cool_message.routing.yml
-----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------
 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.
 9 | ERROR   | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/kushagra.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/cool_message/cool_message.links.menu.yml
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 2 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------


FILE: /Users/kushagra.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/cool_message/src/Form/CoolMessage.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------
  13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
  82 | ERROR   | [x] Expected 1 space after "=>"; 0 found
 116 | WARNING | [ ] Possible useless method overriding detected
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

Time: 104ms; Memory: 10MB

Steps to reproduce

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /modules/contrib/cool_message

Proposed resolution

Fix all the PHP coding standard issues/warnings

📌 Task
Status

RTBC

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024