Drupal Coding Standards Issues | phpcs

Created on 31 January 2023, almost 2 years ago
Updated 14 March 2023, almost 2 years ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal keycloak

FILE: C:\Users\Admin\Desktop\task\keycloak\js\keycloak-session.js
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  61 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  81 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
  89 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 182 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 197 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 243 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\keycloak\src\Controller\KeycloakController.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 86 | ERROR | [x] Expected 1 space between type hint and argument "$session"; 0
    |       |     found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...in\Desktop\task\keycloak\src\EventSubscriber\KeycloakRequestSubscriber.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  39 | ERROR | [x] Expected "\Drupal\openid_connect\OpenIDConnectStateToken"
     |       |     but found "\Drupal\openid_connect\OpenIDConnectStateToken;"
     |       |     for @var tag in member variable comment
 161 | ERROR | [ ] The array declaration extends to column 83 (the limit is
     |       |     80). The array content should be split up over multiple
     |       |     lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...rs\Admin\Desktop\task\keycloak\src\Plugin\OpenIDConnectClient\Keycloak.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  61 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
  62 | ERROR | [x] Array closing indentation error, expected 4 spaces but found
     |       |     6
 561 | ERROR | [x] Expected newline after closing brace
 582 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\Users\Admin\Desktop\task\keycloak\src\Routing\KeycloakRouteSubscriber.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\keycloak\src\Service\KeycloakRoleMatcher.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\keycloak\src\Service\KeycloakService.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\keycloak\src\Service\KeycloakServiceInterface.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 6 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
  5 | WARNING | [x] Unused use statement
  6 | WARNING | [x] Unused use statement
  7 | WARNING | [x] Unused use statement
  8 | WARNING | [x] Unused use statement
  9 | WARNING | [x] Unused use statement
 10 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 680ms; Memory: 12MB

Proposed resolution

Fix the errors and warnings.

📌 Task
Status

Closed: won't fix

Version

2.2

Component

Documentation

Created by

🇮🇳India jay jangid Jaipur

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

Comments & Activities

  • Issue created by @jay jangid
  • @jay-jangid opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India jay jangid Jaipur

    Created MR , please review.

    Thank you.

  • Status changed to Closed: won't fix almost 2 years ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    To discourage people from adding issues, patches or MRs that appear to seek easy commit credits I will not be merging these types of requests. Generally, these tickets create unnecessary noise and maintainer workload.
    If however you feel I'm unfairly confused a meaningful contribution with attempts motivated by earning commit credit, please respond and let me know. I don't want to stand in the way of genuine contribution, only to preserve the valuable time and energy available in the community for meaningful efforts. If I've got this wrong, I want to hear from you.

Production build 0.71.5 2024