Skip to content

Commit b88a3cc

Browse files
committed
fix
1 parent 5a34316 commit b88a3cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rules/CodeQuality/Rector/Expression/DecorateWillReturnMapWithExpectsMockRector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
use PhpParser\Node\Identifier;
1313
use PhpParser\Node\Scalar\Int_;
1414
use PhpParser\Node\Stmt\Expression;
15+
use PHPStan\Type\ObjectType;
1516
use Rector\PHPStan\ScopeFetcher;
17+
use Rector\PHPUnit\Enum\PHPUnitClassName;
1618
use Rector\Rector\AbstractRector;
1719
use Rector\ValueObject\MethodName;
1820
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
@@ -108,6 +110,10 @@ public function refactor(Node $node)
108110
return null;
109111
}
110112

113+
if (! $this->isObjectType($topmostCall->var, new ObjectType(PHPUnitClassName::MOCK_OBJECT))) {
114+
return null;
115+
}
116+
111117
if ($methodCall->isFirstClassCallable()) {
112118
return null;
113119
}

0 commit comments

Comments
 (0)