Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0: Replace the WordPress.PHP.StrictComparisons sniff #1919

Merged
merged 1 commit into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion WordPress-Core/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@

<!-- Rule: Unless absolutely necessary, loose comparisons should not be used,
as their behaviour can be misleading. -->
<rule ref="WordPress.PHP.StrictComparisons"/>
<rule phpcs-only="true" ref="Universal.Operators.StrictComparisons">
<type>warning</type>
</rule>
<rule ref="WordPress.PHP.StrictInArray"/>

<!-- Rule: Assignments must not be placed in placed in conditionals.
Expand Down
54 changes: 0 additions & 54 deletions WordPress/Sniffs/PHP/StrictComparisonsSniff.php

This file was deleted.

21 changes: 0 additions & 21 deletions WordPress/Tests/PHP/StrictComparisonsUnitTest.inc

This file was deleted.

47 changes: 0 additions & 47 deletions WordPress/Tests/PHP/StrictComparisonsUnitTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion bin/class-ruleset-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testing( $param_a, ?bool $param_b = false ): void {
$d = new self();
$e = apply_filter( 'filter_name', $d, $c );

if ( $a == $b ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
if ( $a == $b ) { // phpcs:ignore Universal.Operators.StrictComparisons
$f = isset( $_GET['nonce'] ) ? 1 : 2; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
}

Expand Down