Skip to content

Commit f5ebe18

Browse files
committed
WP/GlobalVariablesOverride: move parse error test to its own file
Also update code comment related to the moved parse error test to include one more case where the code might bow out.
1 parent 88d311f commit f5ebe18

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function process_token( $stackPtr ) {
174174
protected function process_list_assignment( $stackPtr ) {
175175
$list_open_close = Lists::getOpenClose( $this->phpcsFile, $stackPtr );
176176
if ( false === $list_open_close ) {
177-
// Short array, not short list.
177+
// Live coding or short array, not short list.
178178
return;
179179
}
180180

WordPress/Tests/WP/GlobalVariablesOverrideUnitTest.1.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,3 @@ list(
310310
array( $tab, $tabs ) => $not_a_wp_global,
311311
get($year, $day) => &$not_a_wp_global[$year]
312312
] = $array;
313-
314-
// Live coding/parse error.
315-
// This has to be the last test in the file!
316-
list( $tab, $tabs
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
/*
4+
* Intentional parse error (missing closing parenthesis).
5+
* This should be the only test in this file.
6+
*/
7+
8+
list( $tab, $tabs

0 commit comments

Comments
 (0)