File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
rules-tests/CodeQuality/Rector/MethodCall/AssertEqualsToSameRector/Fixture
rules/CodeQuality/Rector/MethodCall Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \AssertEqualsToSameRector \Fixture ;
4+
5+ use PHPUnit \Framework \TestCase ;
6+
7+ final class SkipLooseCompareString extends TestCase
8+ {
9+ public function test ()
10+ {
11+ $ this ->assertEquals (1 , '1 ' );
12+ }
13+ }
Original file line number Diff line number Diff line change @@ -108,11 +108,11 @@ public function refactor(Node $node): ?Node
108108 $ secondArgType = TypeCombinator::removeNull ($ this ->nodeTypeResolver ->getNativeType ($ args [1 ]->value ));
109109
110110 // loose comparison
111- if ($ firstArgType instanceof IntegerType && $ secondArgType instanceof FloatType) {
111+ if ($ firstArgType instanceof IntegerType && ( $ secondArgType instanceof FloatType || $ secondArgType instanceof StringType) ) {
112112 return null ;
113113 }
114114
115- if ($ firstArgType instanceof FloatType && $ secondArgType instanceof IntegerType) {
115+ if ($ firstArgType instanceof FloatType && ( $ secondArgType instanceof IntegerType || $ secondArgType instanceof StringType) ) {
116116 return null ;
117117 }
118118
You can’t perform that action at this time.
0 commit comments