Skip to content

Commit a4ce3ce

Browse files
authored
Merge branch 'trunk' into dependabot/composer/slevomat/coding-standard-8.19.1
2 parents 95d1ab7 + fbb54c5 commit a4ce3ce

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

phpcs-rulesets/plugin-review.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@
163163
<severity>7</severity>
164164
</rule>
165165

166-
<!-- Call-time pass-by-reference has been deprecated since PHP 5.3 and should not be used. -->
167-
<rule ref="Generic.Functions.CallTimePassByReference">
168-
<severity>7</severity>
169-
</rule>
170-
171166
<!-- Check for missing required function parameters. -->
172167
<rule ref="PluginCheck.CodeAnalysis.RequiredFunctionParameters">
173168
<severity>7</severity>

tests/phpunit/testdata/plugins/test-plugin-review-phpcs-errors/load.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

3636
$encoded_value = json_encode( array( 'key' => 'value' ) );
3737

38-
custom_function(&$myvar);
39-
4038
file_get_contents( $url );
4139
file_put_contents();
4240

tests/phpunit/tests/Checker/Checks/Plugin_Review_PHPCS_Check_Tests.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,20 @@ public function test_run_with_errors() {
4545
// Check for PluginCheck.CodeAnalysis.RequiredFunctionParameters.parse_str_resultMissing error on Line no 34 and column no at 1.
4646
$this->assertSame( 'PluginCheck.CodeAnalysis.RequiredFunctionParameters.parse_str_resultMissing', $errors['load.php'][34][1][0]['code'] );
4747

48-
// Check for Generic.Functions.CallTimePassByReference.NotAllowed error on Line no 38 and column no 16.
49-
$this->assertSame( 'Generic.Functions.CallTimePassByReference.NotAllowed', $errors['load.php'][38][16][0]['code'] );
50-
5148
// Check for Generic.Files.ByteOrderMark.Found error on Line no 1 and column no 1.
5249
$this->assertSame( 'Generic.Files.ByteOrderMark.Found', $errors['file-with-bom.php'][1][1][0]['code'] );
5350

5451
// There should not be WordPress.WP.AlternativeFunctions.json_encode_json_encode error on Line no 36 and column no at 18.
5552
$this->assertCount( 0, wp_list_filter( $errors['load.php'][36][18], array( 'code' => 'WordPress.WP.AlternativeFunctions.json_encode_json_encode' ) ) );
5653

57-
// There should not be WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents error on Line no 40 and column no 1.
58-
$this->assertCount( 0, wp_list_filter( $errors['load.php'][40][1], array( 'code' => 'WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents' ) ) );
54+
// There should not be WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents error on Line no 38 and column no 1.
55+
$this->assertCount( 0, wp_list_filter( $errors['load.php'][38][1], array( 'code' => 'WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents' ) ) );
5956

60-
// There should not be WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents error on Line no 41 and column no 1.
61-
$this->assertCount( 0, wp_list_filter( $errors['load.php'][41][1], array( 'code' => 'WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents' ) ) );
57+
// There should not be WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents error on Line no 39 and column no 1.
58+
$this->assertCount( 0, wp_list_filter( $errors['load.php'][39][1], array( 'code' => 'WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents' ) ) );
6259

63-
// Check for PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound error on Line no 43 and column no at 1.
64-
$this->assertSame( 'PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound', $errors['load.php'][43][1][0]['code'] );
60+
// Check for PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound error on Line no 41 and column no at 1.
61+
$this->assertSame( 'PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound', $errors['load.php'][41][1][0]['code'] );
6562

6663
// Check for WordPress.Security.ValidatedSanitizedInput warnings on Line no 15 and column no at 27.
6764
$this->assertCount( 1, wp_list_filter( $warnings['load.php'][15][27], array( 'code' => 'WordPress.Security.ValidatedSanitizedInput.InputNotValidated' ) ) );

0 commit comments

Comments
 (0)