Fix the issues reported by phpcs

Created on 9 May 2023, about 1 year ago
Updated 12 March 2024, 3 months ago

Problem/Motivation


FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\onlyone\onlyone.drush.inc
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
 376 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\onlyone\tests\src\Functional\OnlyOneAdminSettingsTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 37 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\onlyone\tests\src\Unit\OnlyOneTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------
 435 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
 436 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

Time: 718ms; Memory: 14MB

Steps to reproduce

Run following command
phpcs --standard=“Drupal,DrupalPractice” --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml .

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India sidharth_soman 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 @sidharth_soman
  • 🇮🇳India sidharth_soman Bangalore

    I will solve the above issues and provide an MR for it.

  • Merge request !2Fixed phpcs issues. → (Merged) created by sidharth_soman
  • Open on Drupal.org →
    Core: 10.0.5 + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    Waiting for branch to pass
  • Assigned to sidharth_soman
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India sidharth_soman Bangalore

    I've raised an MR which fixes all the issues except for those related to array declarations (keeping them as it is for readability) and filling out or editing documentation. I can modify the MR later if those are required.

    Please review.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India imustakim Ahmedabad

    Issue summary updated.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The report shows warnings/errors for 33 files, while the MR changes just four files. The MR is not complete.

  • Gaurav Gupta Jaipur, Rajasthsan

    Gaurav Gupta made their first commit to this issue’s fork.

  • Open on Drupal.org →
    Core: 10.0.11 + Environment: PHP 8.2 & MySQL 8
    last update 7 months ago
    Waiting for branch to pass
  • 🇮🇳India zkhan.aamir

    Hi,

    MR #11 applied successfully.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/onlyone (2.x)
    $ curl https://git.drupalcode.org/project/onlyone/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 19544    0 19544    0     0  45730      0 --:--:-- --:--:-- --:--:-- 45877
    patching file modules/onlyone_admin_toolbar/onlyone_admin_toolbar.module
    patching file modules/onlyone_admin_toolbar/src/EventSubscriber/ContentTypesUpdatedSubscriber.php
    patching file modules/onlyone_admin_toolbar/src/OnlyOneAdminToolbar.php
    patching file modules/onlyone_admin_toolbar/src/OnlyOneAdminToolbarInterface.php
    patching file modules/onlyone_admin_toolbar/tests/src/Unit/OnlyOneAdminToolbarTest.php
    patching file onlyone.drush.inc
    patching file onlyone.module
    patching file src/Event/OnlyOneEvents.php
    patching file src/Form/ConfigContentTypes.php
    patching file src/Form/OnlyOneAdminSettings.php
    patching file src/OnlyOne.php
    patching file src/OnlyOneInterface.php
    patching file src/OnlyOneModuleHandler.php
    patching file src/OnlyOneModuleHandlerInterface.php
    patching file src/OnlyOnePrintAdminPage.php
    patching file src/OnlyOnePrintDrush.php
    patching file src/OnlyOnePrintStrategyInterface.php
    patching file src/Plugin/Validation/Constraint/OnlyOneConstraintValidator.php
    patching file src/Routing/OnlyOneRoutes.php
    patching file src/Routing/RouteSubscriber.php
    patching file tests/src/Functional/OnlyOneAdminSettingsTest.php
    patching file tests/src/Kernel/OnlyOneConstraintValidatorTest.php
    patching file tests/src/Unit/OnlyOneModuleHandlerTest.php
    patching file tests/src/Unit/OnlyOnePrintAdminPageTest.php
    patching file tests/src/Unit/OnlyOnePrintDrushTest.php
    patching file tests/src/Unit/OnlyOneTest.php
    

    Still there are warning and errors remianing.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib
    $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml onlyone/
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\onlyone\onlyone.drush.inc
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------
     376 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\onlyone\onlyone.module
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------
     66 | ERROR | The array declaration extends to column 311 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\onlyone\README.md
    ----------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------
     85 | WARNING | Line exceeds 80 characters; contains 81 characters
    ----------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\onlyone\src\OnlyOne.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------
     383 | ERROR | The array declaration extends to column 230 (the limit is 80). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\onlyone\tests\src\Functional\OnlyOneAdminSettingsTest.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     37 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
    -------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\onlyone\tests\src\Traits\OnlyOneUnitTestTrait.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------
     185 | ERROR | The array declaration extends to column 241 (the limit is 80). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\onlyone\tests\src\Unit\OnlyOneTest.php
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------------------------------------------
     435 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
     436 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 756ms; Memory: 14MB
    
  • bindu r made their first commit to this issue’s fork.

  • Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 5 months ago
    Waiting for branch to pass
  • 🇮🇳India zkhan.aamir

    Hi,

    MR #13 applied successfully.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/onlyone (2.x)
    $ curl https://git.drupalcode.org/project/onlyone/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 23998    0 23998    0     0  64395      0 --:--:-- --:--:-- --:--:-- 64684
    patching file README.md
    patching file modules/onlyone_admin_toolbar/onlyone_admin_toolbar.module
    patching file modules/onlyone_admin_toolbar/src/EventSubscriber/ContentTypesUpdatedSubscriber.php
    patching file modules/onlyone_admin_toolbar/src/OnlyOneAdminToolbar.php
    patching file modules/onlyone_admin_toolbar/src/OnlyOneAdminToolbarInterface.php
    patching file modules/onlyone_admin_toolbar/tests/src/Unit/OnlyOneAdminToolbarTest.php
    patching file onlyone.drush.inc
    patching file onlyone.module
    patching file src/Event/OnlyOneEvents.php
    patching file src/Form/ConfigContentTypes.php
    patching file src/Form/OnlyOneAdminSettings.php
    patching file src/OnlyOne.php
    patching file src/OnlyOneInterface.php
    patching file src/OnlyOneModuleHandler.php
    patching file src/OnlyOneModuleHandlerInterface.php
    patching file src/OnlyOnePrintAdminPage.php
    patching file src/OnlyOnePrintDrush.php
    patching file src/OnlyOnePrintStrategyInterface.php
    patching file src/Plugin/Validation/Constraint/OnlyOneConstraintValidator.php
    patching file src/Routing/OnlyOneRoutes.php
    patching file src/Routing/RouteSubscriber.php
    patching file tests/src/Functional/OnlyOneAdminSettingsTest.php
    patching file tests/src/Kernel/OnlyOneConstraintValidatorTest.php
    patching file tests/src/Traits/OnlyOneUnitTestTrait.php
    patching file tests/src/Unit/OnlyOneModuleHandlerTest.php
    patching file tests/src/Unit/OnlyOnePrintAdminPageTest.php
    patching file tests/src/Unit/OnlyOnePrintDrushTest.php
    patching file tests/src/Unit/OnlyOneTest.php
    

    Remaining errors

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules
    $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml onlyone/
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\onlyone\onlyone.drush.inc
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------
     376 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\onlyone\tests\src\Functional\OnlyOneAdminSettingsTest.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     37 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
    -------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\onlyone\tests\src\Unit\OnlyOneTest.php
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------------------------------------------
     435 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
     436 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 718ms; Memory: 14MB
    
  • 🇮🇳India zkhan.aamir

    Issue summary updated.

  • Status changed to Fixed 4 months ago
  • 🇨🇦Canada adriancid Montreal, Canada
    • adriancid committed 5b067da0 on 2.x
      Issue #3359005 by sidharth_soman, Gaurav Gupta, bindu r, apaderno, zkhan...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024