Fix phpcs Drupal.Arrays.Array issues

Created on 1 January 2024, 6 months ago
Updated 18 February 2024, 4 months ago

Problem/Motivation

Command:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig modules/custom/pathauto/ --sniffs="Drupal.Arrays.Array"

Result:


FILE: tests/src/Functional/PathautoNodeWebTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 291 | ERROR | The array declaration extends to column 125 (the limit is 120). The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: tests/src/Functional/PathautoMassDeleteTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 100 | ERROR | The array declaration extends to column 150 (the limit is 120). The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: tests/src/Kernel/PathautoTokenTest.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  92 | ERROR | The array declaration extends to column 156 (the limit is 120). The array content should be split up over multiple lines
  95 | ERROR | The array declaration extends to column 125 (the limit is 120). The array content should be split up over multiple lines
  98 | ERROR | The array declaration extends to column 298 (the limit is 120). The array content should be split up over multiple lines
 101 | ERROR | The array declaration extends to column 251 (the limit is 120). The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: tests/src/Kernel/PathautoEntityWithStringIdTest.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
 114 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 117 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 120 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 123 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 126 | WARNING | [x] A comma should follow the last multiline array item. Found: '123'
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: tests/src/FunctionalJavascript/PathautoLocaleTest.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------
 107 | WARNING | [x] A comma should follow the last multiline array item. Found: 'create content translations'
 202 | ERROR   | [ ] The array declaration extends to column 133 (the limit is 120). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: pathauto.module
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  55 | ERROR | The array declaration extends to column 656 (the limit is 120). The array content should be split up over multiple lines
 164 | ERROR | The array declaration extends to column 220 (the limit is 120). The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: pathauto.install
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 176 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: src/Form/PathautoAdminDelete.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 90 | ERROR | The array declaration extends to column 181 (the limit is 120). The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: src/Form/PatternEditForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 240 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 255 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: src/Plugin/Deriver/EntityAliasTypeDeriver.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 89 | WARNING | [x] A comma should follow the last multiline array item. Found: )
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php
---------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------
 193 | ERROR | [ ] The array declaration extends to column 126 (the limit is 120). The array content should be split up over multiple lines
 284 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
 285 | ERROR | [x] Array closing indentation error, expected 6 spaces but found 8
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------

Time: 1.07 secs; Memory: 8MB

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇷🇺Russia zniki.ru

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

Production build 0.69.0 2024