Skip to content

Commit 37f3271

Browse files
committed
fix
1 parent 87fa142 commit 37f3271

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

rules-tests/CodeQuality/Rector/CallLike/DirectInstanceOverMockArgRector/Fixture/skip_first_class_callable.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ final class SkipFirstClassCallable extends TestCase
1010
{
1111
AnyClass::staticRun(...);
1212
}
13-
}
13+
}

rules/CodeQuality/Rector/CallLike/DirectInstanceOverMockArgRector.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ public function refactor(Node $node): MethodCall|StaticCall|New_|ArrayItem|null
101101
$hasChanged = false;
102102

103103
if ($node instanceof ArrayItem) {
104-
105104
return $this->refactorArrayItem($node);
106105
}
107106

107+
if ($node->isFirstClassCallable()) {
108+
return null;
109+
}
110+
108111
foreach ($node->getArgs() as $arg) {
109112
$firstArg = $this->matchCreateMockMethodCallArg($arg->value);
110113
if (! $firstArg instanceof Arg) {

0 commit comments

Comments
 (0)