Skip to content

Commit 3b48279

Browse files
committed
fix
1 parent 288f2e7 commit 3b48279

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rules/Configs/Rector/Closure/FromServicePublicToDefaultsPublicRector.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
public function getRuleDefinition(): RuleDefinition
2929
{
3030
return new RuleDefinition(
31-
'Instead of per service public() call, use it once in defaults()',
31+
'Instead of per service public() call, use it once in $services->defaults()->public()',
3232
[
3333
new CodeSample(
3434
<<<'CODE_SAMPLE'
@@ -94,12 +94,12 @@ public function refactor(Node $node): ?Node
9494
return null;
9595
}
9696

97-
if (! $this->isName($node->name, 'public') && $node->getArgs() === []) {
97+
if (! $this->isName($node->name, 'public')) {
9898
return null;
9999
}
100100

101-
// not the ->defaults()->public()
102-
if ($this->isDefaultCall($node)) {
101+
// skip ->defaults()->public()
102+
if ($this->isDefaultsCall($node)) {
103103
return null;
104104
}
105105

@@ -119,7 +119,7 @@ public function refactor(Node $node): ?Node
119119
return $node;
120120
}
121121

122-
public function isDefaultCall(MethodCall $methodCall): bool
122+
public function isDefaultsCall(MethodCall $methodCall): bool
123123
{
124124
$currentMethodCall = $methodCall;
125125
while ($currentMethodCall instanceof MethodCall) {

0 commit comments

Comments
 (0)