Skip to content

Commit e8e55ae

Browse files
committed
[rector] Rector fixes
1 parent 287fca2 commit e8e55ae

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

config/sets/phpunit120.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Rector\Config\RectorConfig;
66
use Rector\PHPUnit\PHPUnit120\Rector\CallLike\CreateStubOverCreateMockArgRector;
7-
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsWithoutExpectationsAttributeRector;
87
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AssertIsTypeMethodCallRector;
98
use Rector\PHPUnit\PHPUnit120\Rector\Class_\RemoveOverrideFinalConstructTestCaseRector;
109

rules/PHPUnit120/Rector/Class_/AllowMockObjectsWithoutExpectationsAttributeRector.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Rector\PHPUnit\PHPUnit120\Rector\Class_;
66

7+
use PhpParser\Node\Expr\MethodCall;
8+
use PhpParser\Node\Expr\PropertyFetch;
79
use PhpParser\Node;
810
use PhpParser\Node\Attribute;
911
use PhpParser\Node\AttributeGroup;
@@ -205,10 +207,10 @@ private function isClassMethodUsingMethodCallOnPropertyNamed(
205207
ClassMethod $classMethod,
206208
string $mockObjectPropertyName
207209
): bool {
208-
/** @var Node\Expr\MethodCall[] $methodCalls */
209-
$methodCalls = $this->betterNodeFinder->findInstancesOfScoped([$classMethod], [Node\Expr\MethodCall::class]);
210+
/** @var MethodCall[] $methodCalls */
211+
$methodCalls = $this->betterNodeFinder->findInstancesOfScoped([$classMethod], [MethodCall::class]);
210212
foreach ($methodCalls as $methodCall) {
211-
if (! $methodCall->var instanceof Node\Expr\PropertyFetch) {
213+
if (! $methodCall->var instanceof PropertyFetch) {
212214
continue;
213215
}
214216

@@ -225,7 +227,7 @@ private function isClassMethodUsingMethodCallOnPropertyNamed(
225227

226228
private function shouldAddAttribute(array $missedTestMethodsByMockPropertyName): bool
227229
{
228-
foreach ($missedTestMethodsByMockPropertyName as $propertyName => $missedTestMethods) {
230+
foreach ($missedTestMethodsByMockPropertyName as $missedTestMethods) {
229231
// all test methods are using method calls on the mock property, so skip
230232
if (count($missedTestMethods) === 0) {
231233
continue;

0 commit comments

Comments
 (0)