diff --git a/rules/CodeQuality/Rector/MethodCall/MatchAssertSameExpectedTypeRector.php b/rules/CodeQuality/Rector/MethodCall/MatchAssertSameExpectedTypeRector.php index 7492cdea..575ce818 100644 --- a/rules/CodeQuality/Rector/MethodCall/MatchAssertSameExpectedTypeRector.php +++ b/rules/CodeQuality/Rector/MethodCall/MatchAssertSameExpectedTypeRector.php @@ -7,7 +7,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Expr\StaticCall; -use PhpParser\Node\Scalar\LNumber; +use PhpParser\Node\Scalar\Int_; use PhpParser\Node\Scalar\String_; use PHPStan\Type\TypeCombinator; use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer; @@ -95,7 +95,7 @@ public function refactor(Node $node): ?Node } $expectedArg = $node->getArgs()[0]; - if (! $expectedArg->value instanceof String_ && ! $expectedArg->value instanceof LNumber) { + if (! $expectedArg->value instanceof String_ && ! $expectedArg->value instanceof Int_) { return null; } @@ -109,7 +109,7 @@ public function refactor(Node $node): ?Node if ($expectedType->isLiteralString()->yes() && $directVariableType->isInteger()->yes()) { // update expected type to provided type - $expectedArg->value = new LNumber((int) $expectedArg->value->value); + $expectedArg->value = new Int_((int) $expectedArg->value->value); return $node; }