Drupal Coding Standards Issues | phpcs

Created on 20 January 2023, over 1 year ago
Updated 25 January 2023, over 1 year ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal config_log

FILE: C:\Users\Admin\Desktop\task\config_log\config_log.drush.inc
--------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
 16 | ERROR   | [x] Short array syntax must be used to define arrays
 17 | ERROR   | [x] Short array syntax must be used to define arrays
 19 | ERROR   | [x] Short array syntax must be used to define arrays
 22 | ERROR   | [x] Short array syntax must be used to define arrays
 34 | WARNING | [x] '@todo - don't bother with local repo. Push using Github
    |         |     file contents API.' should match the format '@todo Fix
    |         |     problem X here.'
 44 | ERROR   | [x] Short array syntax must be used to define arrays
 64 | WARNING | [x] '@todo: Don't assume hard coded remote name and branch
    |         |     name.' should match the format '@todo Fix problem X here.'
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...esktop\task\config_log\src\EventSubscriber\ConfigLogDatabaseSubscriber.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
    |         |     with a file doc comment
 11 | WARNING | [x] Unused use statement
 17 | WARNING | [x] Unused use statement
 20 | WARNING | [x] Unused use statement
 21 | WARNING | [x] Unused use statement
 75 | ERROR   | [ ] Missing parameter type
 78 | ERROR   | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...in\Desktop\task\config_log\src\EventSubscriber\ConfigLogMailSubscriber.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
    |         |     with a file doc comment
 14 | WARNING | [x] Unused use statement
 18 | WARNING | [x] Unused use statement
 64 | ERROR   | [ ] Parameter $current_user is not described in comment
 84 | ERROR   | [x] Visibility must be declared on method "getSubscribedEvents"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...min\Desktop\task\config_log\src\EventSubscriber\ConfigLogPsrSubscriber.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
     |         |     "\r\n"
   3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
     |         |     with a file doc comment
  14 | WARNING | [x] Unused use statement
  18 | WARNING | [x] Unused use statement
  55 | ERROR   | [x] Visibility must be declared on method
     |         |     "getSubscribedEvents"
 126 | ERROR   | [ ] The array declaration extends to column 118 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...in\Desktop\task\config_log\src\EventSubscriber\ConfigLogSubscriberBase.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
    |         |     with a file doc comment
 74 | WARNING | [ ] The use of function fnmatch() is discouraged
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\config_log\src\Form\ConfigLogConfigForm.php
--------------------------------------------------------------------------------
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: ...dmin\Desktop\task\config_log\tests\src\Unit\ConfigLogPsrSubscriberTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
 3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
   |       |     with a file doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\config_log\tests\src\Unit\ContextLogger.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 16 | ERROR | [ ] Doc comment short description must be on a single line,
    |       |     further text should be a separate paragraph
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\config_log\tests\src\Unit\MemoryStorage.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  15 | ERROR | [ ] Missing short description in doc comment
  84 | ERROR | [ ] Missing short description in doc comment
  91 | ERROR | [ ] Missing short description in doc comment
  98 | ERROR | [ ] Missing short description in doc comment
 105 | ERROR | [ ] Missing short description in doc comment
 112 | ERROR | [ ] Missing short description in doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 541ms; Memory: 8MB

Proposed resolution

Fix the errors and warnings.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇳India Jay Jangid

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024