Fix the issues reported by phpcs

Created on 27 March 2023, over 1 year ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

FILE: ~/projects/drupal-d10/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: ~/projects/drupal-d10/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: 105ms; Memory: 10MB

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml m4032404 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India rassoni Bangalore

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

Merge Requests

Comments & Activities

  • Issue created by @rassoni
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India rassoni Bangalore

    Fixed Coding standard and created MR. Please review.

  • Issue was unassigned.
  • 🇮🇳India rassoni Bangalore
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
     /**
    - * Class M4032404Form.
    + * Defines the m4032404 form.
      *
      * @package Drupal\m4032404\Form
      */

    The description should be improved, since it is not clear what the m4032404 form should be.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India rassoni Bangalore

    Thanks @apaderno, Addressed #5 feedback. Please review

  • Status changed to Needs work 3 months ago
  • Hi @Rassoni,

    The changes you made on MR!2 can be applied successfully, but there are still errors reported. Please see below:

    ➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig m4032404
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/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/PrometInterns/Demo-site/drupal-orgissue-v9/web/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: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/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: 182ms; Memory: 10MB

    Please check

    Thanks,
    Jake

  • Pipeline finished with Failed
    3 months ago
    Total: 133s
    #259659
  • Assigned to apaderno
  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Pipeline finished with Failed
    3 months ago
    Total: 375s
    #259927
Production build 0.71.5 2024