Skip to content

Commit 199dd57

Browse files
committed
WordPressVIPMinimum: alternative fix for the failing ruleset test
Follow up on the original fix. * Now, instead of having a condition for the PHP 5 parse error, the `$this` variable has been renamed to `$stdClass`. * And the PHP 7 parse error on line 7 has been changed to a syntax which is a parse error on both PHP 5 as well as 7.
1 parent f85ced2 commit 199dd57

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

WordPressVIPMinimum/ruleset-test.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<?php // Error - Squiz.WhiteSpace.SuperfluousWhitespace.
55
$hello = ''; $posts_not_in = ''; $listofthings = ''; $cachedlistofthings = ''; $title = ''; $ch = ''; $thing = ''; $descriptorspec = ''; $pipes = ''; $cwd = ''; $env = ''; $page_title = ''; $menu_title = ''; $capability = ''; $function = ''; $icon_url = ''; $position = ''; $wpdb = ''; $file = ''; $fp = ''; $dir = ''; $test = ''; $post = ''; $bar = ''; $array = []; $query_args = []; $url = ''; $query = ''; $page_title = ''; $true = true; $some_nasty_var = ''; $data = ''; $group = ''; $testing = ''; $stdClass = new stdClass(); $needle = ''; $some_var = ''; $blogid = 1; $text = ''; $category_id = 123; $foo = ''; $bar = ''; $var = ''; $wp_rewrite = ''; $count = 1; $loop = 1; $a = ''; $b = ''; $obj = ''; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- All set for VariableAnalysis checks.
66
// Generic.PHP.Syntax
7-
while { // Error.
7+
foreach() { // Error.
88
}
99

1010
// Generic.PHP.NoSilencedErrors

WordPressVIPMinimum/ruleset-test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$expected = [
1717
'errors' => [
1818
4 => 1,
19-
7 => ( version_compare( PHP_VERSION_ID, '70000', '>=' ) ? 1 : 0 ),
19+
7 => 1,
2020
11 => 1,
2121
16 => 1,
2222
17 => 1,

0 commit comments

Comments
 (0)