Resolve Issues reported by phpcs

Created on 24 August 2023, 10 months ago
Updated 24 May 2024, about 1 month ago

Problem/Motivation

FILE: ...PAL/modules/contrib/m4032404/tests/src/Functional/M4032404TestCaseTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | [x] Whitespace found at end of line
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /var/www/TS_DRUPAL/modules/contrib/m4032404/src/Form/M4032404Form.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
 12 | WARNING | [ ] The class short comment should describe what the class does
    |         |     and not simply repeat the class name
 28 | ERROR   | [x] Short array syntax must be used to define arrays
 35 | ERROR   | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...L/modules/contrib/m4032404/src/EventSubscriber/M4032404EventSubscriber.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 80 | ERROR | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 132ms; Memory: 10MB

๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Neha Wadhwani

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 @Neha Wadhwani
  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia TanujJain-TJ

    Tanuj. โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    Hi Patch provided in #2 get applied cleanly but still throwing error.
    Providing updated patch.

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/m4032404

    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/m4032404/tests/src/Unit/EventSubscriber/M4032404EventSubscriberTest.php
    -------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------
    6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\m4032404\EventSubscriber\M4032404EventSubscriber.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/m4032404/src/EventSubscriber/M4032404EventSubscriber.php
    -----------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------
    6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface.
    -----------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------

    Time: 127ms; Memory: 10MB

  • Status changed to RTBC about 1 month ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines cleavinjosh

    Hi @Ashutosh Ahirwal,

    I applied patch #4, it was applied cleanly and fixed the issues.

    โžœ  m4032404 git:(8.x-1.0-alpha6) curl https://www.drupal.org/files/issues/2024-03-05/coding_standard-3383044-4.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3579  100  3579    0     0   5397      0 --:--:-- --:--:-- --:--:--  5406
    patching file src/EventSubscriber/M4032404EventSubscriber.php
    patching file src/Form/M4032404Form.php
    patching file tests/src/Functional/M4032404TestCaseTest.php
    patching file tests/src/Unit/EventSubscriber/M4032404EventSubscriberTest.php
    โžœ  m4032404 git:(8.x-1.0-alpha6) โœ— ..
    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml m4032404
    โžœ  contrib git:(main) โœ—

    I am moving this to Reviewed & tested by the community.

    Thank you.

Production build 0.69.0 2024