It is likely that the next release of Coder will include the modification #3153448: Why is a two-element array allowed to exceed the maximum line length?. This will mean that the following errors will be reported:
FILE: scheduler/scheduler.module
------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------
379 | ERROR | The array declaration line has 104 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
------------------------------------------------------------------------------------------
FILE: ...scheduler/scheduler_rules_integration/scheduler_rules_integration.rules_defaults.inc
------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------
25 | ERROR | The array declaration line has 115 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
40 | ERROR | The array declaration line has 115 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
------------------------------------------------------------------------------------------
FILE: ...scheduler/tests/src/Functional/SchedulerPastDatesTest.php
------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------
97 | ERROR | The array declaration line has 82 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
------------------------------------------------------------------------------------------
FILE: ... scheduler/tests/src/Functional/SchedulerRulesEventsTest.php
------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
------------------------------------------------------------------------------------------
56 | ERROR | The array declaration line has 126 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
57 | ERROR | The array declaration line has 135 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
58 | ERROR | The array declaration line has 105 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
59 | ERROR | The array declaration line has 130 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
60 | ERROR | The array declaration line has 139 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
61 | ERROR | The array declaration line has 109 characters (the limit is 80). The array
| | content should be split up over multiple lines
| | (Drupal.Arrays.Array.LongLineDeclaration)
------------------------------------------------------------------------------------------
Instead of altering the source, we can chose to extend the 80-char limit (which is, by some accounts, fairly outdated now anyway). The phpcs.xml.dist setting for the array checking limit Y can be set separately from the overall line length X, and individual files can have their own limit Z
<rule ref="Drupal.Files.LineLength">
<properties>
<property name="lineLimit" value="X"/>
</properties>
</rule>
<rule ref="Drupal.Arrays.Array">
<properties>
<property name="lineLimit" value="Y"/>
</properties>
</rule>
*
* phpcs:set Drupal.Arrays.Array lineLimit Z
*
Comments
Comment #2
jonathan1055 commentedSetting the main limit to 120 is fine, but 140 is too much for all files. However, we can make a special case for the test file, and add
* phpcs:set Drupal.Arrays.Array lineLimit 140to the header for that file only.Comment #3
jonathan1055 commentedIn preparation for the new sniff, might as well get this done now.
Comment #5
jonathan1055 commentedComment #6
jonathan1055 commentedUpdated IS to include individual file limit.
Comment #8
jonathan1055 commentedChanged title for accuracy.