Skip to content

Commit d54ceaa

Browse files
committed
[CodeQuality] Skip docblock base type on 2nd arg on MatchAssertSameExpectedTypeRector
1 parent 8fd63f1 commit d54ceaa

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\MatchAssertSameExpectedTypeRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
final class SkipDocblockType extends TestCase
8+
{
9+
public function run()
10+
{
11+
$this->assertSame('123', $this->getOrderId());
12+
}
13+
14+
/**
15+
* @return int
16+
*/
17+
private function getOrderId()
18+
{
19+
return '123';
20+
}
21+
}

rules/CodeQuality/Rector/MethodCall/MatchAssertSameExpectedTypeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function refactor(Node $node): ?Node
103103

104104
$variableExpr = $node->getArgs()[1]
105105
->value;
106-
$variableType = $this->getType($variableExpr);
106+
$variableType = $this->nodeTypeResolver->getNativeType($variableExpr);
107107

108108
$directVariableType = TypeCombinator::removeNull($variableType);
109109

0 commit comments

Comments
 (0)