Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down