Skip to content

Commit e0acb2e

Browse files
committed
[rector] Rector fixes
1 parent 85433d6 commit e0acb2e

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;
@@ -219,10 +221,10 @@ private function isClassMethodUsingMethodCallOnPropertyNamed(
219221
ClassMethod $classMethod,
220222
string $mockObjectPropertyName
221223
): bool {
222-
/** @var Node\Expr\MethodCall[] $methodCalls */
223-
$methodCalls = $this->betterNodeFinder->findInstancesOfScoped([$classMethod], [Node\Expr\MethodCall::class]);
224+
/** @var MethodCall[] $methodCalls */
225+
$methodCalls = $this->betterNodeFinder->findInstancesOfScoped([$classMethod], [MethodCall::class]);
224226
foreach ($methodCalls as $methodCall) {
225-
if (! $methodCall->var instanceof Node\Expr\PropertyFetch) {
227+
if (! $methodCall->var instanceof PropertyFetch) {
226228
continue;
227229
}
228230

@@ -242,7 +244,7 @@ private function isClassMethodUsingMethodCallOnPropertyNamed(
242244
*/
243245
private function shouldAddAttribute(array $missedTestMethodsByMockPropertyName): bool
244246
{
245-
foreach ($missedTestMethodsByMockPropertyName as $propertyName => $missedTestMethods) {
247+
foreach ($missedTestMethodsByMockPropertyName as $missedTestMethods) {
246248
// all test methods are using method calls on the mock property, so skip
247249
if (count($missedTestMethods) === 0) {
248250
continue;

0 commit comments

Comments
 (0)