Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal stackpath

FILE: ...\Users\Admin\Desktop\task\stackpath\src\Entity\StackPathPurgerSettings.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: C:\Users\Admin\Desktop\task\stackpath\src\Event\StackPathPurgerEvents.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: ...Users\Admin\Desktop\task\stackpath\src\Event\StackPathPurgerItemsAlter.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 33 | ERROR | [ ] Missing parameter comment
 34 | ERROR | [ ] Missing parameter comment
 54 | ERROR | [ ] Missing parameter comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\Users\Admin\Desktop\task\stackpath\src\Form\StackPathPurgerConfigForm.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 10 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be
    |       |     referenced with use statements
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...top\task\stackpath\src\Plugin\Purge\DiagnosticCheck\ConfigurationCheck.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: ...s\Admin\Desktop\task\stackpath\src\Plugin\Purge\Purger\StackPathPurger.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
     |         |     "\r\n"
  13 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be
     |         |     referenced with use statements
  14 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be
     |         |     referenced with use statements
  17 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be
     |         |     referenced with use statements
 135 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 149 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 190 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 281 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...Desktop\task\stackpath\src\Plugin\Purge\TagsHeader\StackPathTagsHeader.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: C:\Users\Admin\Desktop\task\stackpath\src\StackPathApi.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"
 10 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be
    |         |     referenced with use statements
 17 | WARNING | [ ] The class short comment should describe what the class does
    |         |     and not simply repeat the class name
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 580ms; Memory: 10MB

Proposed resolution

Fix the errors and warnings.

Issue fork stackpath-3338218

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jay Jangid created an issue. See original summary.

jay jangid’s picture

Assigned: jay jangid » Unassigned
Status: Active » Needs review

Created MR , please review.

Thank you.

jcnventura’s picture

Status: Needs review » Needs work

There were a few extra coding standards after applying the MR:

FILE: /home/jcv/drupal/git/stackpath/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 16 | WARNING | Line exceeds 80 characters; contains 98 characters
----------------------------------------------------------------------


FILE: /home/jcv/drupal/git/stackpath/src/StackPathApi.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
 10 | WARNING | [x] Unused use statement
 10 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
 17 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /home/jcv/drupal/git/stackpath/stackpath.services.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

  • jcnventura authored 91f4fdab on 8.x-1.x
    Issue #3338218 by Jay Jangid, jcnventura: Drupal Coding Standards Issues...
jcnventura’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.