Fix the issues repored by phpcs.

Created on 10 May 2023, over 1 year ago
Updated 3 July 2023, over 1 year ago

Problem/Motivation

Found these issues repored by phpcs:

FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/pelcro_auth/pelcro_auth.module
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
 78 | ERROR | [x] Language constructs must be followed by a single space; expected 1 space but found "\n"
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/pelcro_auth/tests/src/Unit/UtilTest.php
--------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
 23 | ERROR | Parameter tags must be grouped together in a doc comment
--------------------------------------------------------------------------------------------------------------


FILE: ...rs/studenttrainees/New/drupalorgsite/docroot/modules/contrib/pelcro_auth/tests/src/Functional/PelcroRedirectTest.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------
 24 | ERROR | [ ] Missing member variable doc comment
 26 | ERROR | [x] Missing function doc comment
 29 | ERROR | [x] Expected 1 blank line after function; 0 found
 30 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/pelcro_auth/src/Controller/UserController.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------
 324 | ERROR | [x] Expected 1 space before opening brace; found 2
 326 | ERROR | [x] No space found before comment text; expected "// check for existing user" but found "//check for
     |       |     existing user"
 326 | ERROR | [x] Inline comments must start with a capital letter
 326 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
     |       |     parentheses
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/pelcro_auth/src/Util.php
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 45 | ERROR | [x] There should be no white space before a closing ")"
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------


FILE: ...studenttrainees/New/drupalorgsite/docroot/modules/contrib/pelcro_auth/src/EventSubscriber/AccessDeniedSubscriber.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
 53 | ERROR | [x] Expected 1 space after IF keyword; 2 found
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

Time: 606ms; Memory: 12MB


Steps to reproduce

Run this command in the folder of the module "phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml"

Proposed resolution

Remaining tasks

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇵🇭Philippines paraderojether

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

  • Issue created by @paraderojether
  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    18 pass
  • @_pratik_ opened merge request.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    18 pass
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India _pratik_ Banglore
  • Issue was unassigned.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    18 pass
  • 🇵🇭Philippines paraderojether

    Created a patch to fix the issue reported by phpcs.

    Please review.
    Thank You.

  • Status changed to RTBC over 1 year ago
  • 🇵🇭Philippines roberttabigue

    Hi,

    I reviewed the changes and confirmed the Patch was applied cleanly.

    Checking patch pelcro_auth.module...
    Checking patch src/Controller/UserController.php...
    Checking patch src/EventSubscriber/AccessDeniedSubscriber.php...
    Checking patch src/Util.php...
    Checking patch tests/src/Functional/PelcroRedirectTest.php...
    Checking patch tests/src/Unit/UtilTest.php...
    Applied patch pelcro_auth.module cleanly.
    Applied patch src/Controller/UserController.php cleanly.
    Applied patch src/EventSubscriber/AccessDeniedSubscriber.php cleanly.
    Applied patch src/Util.php cleanly.
    Applied patch tests/src/Functional/PelcroRedirectTest.php cleanly.
    Applied patch tests/src/Unit/UtilTest.php cleanly.

    And all PHPCS errors have been fixed.

    I ran this command:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml


    Applied to Pelcro Authorization module with 1.x-dev version and with the Drupal core version of 9.5.x.

    Attaching screenshots and moving this to RTBC.

    Thank you!

Production build 0.71.5 2024