Skip to content

Commit 081ea60

Browse files
committed
fix larastan
1 parent eea74d2 commit 081ea60

8 files changed

+8
-9
lines changed

src/Rules/AttributesCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public function check(
127127
$nodeAttributes['isAttribute'] = true;
128128

129129
$parameterErrors = $this->functionCallParametersCheck->check(
130-
$attributeConstructor,
131130
ParametersAcceptorSelector::selectFromArgs(
132131
$scope,
133132
$attribute->args,
@@ -156,6 +155,7 @@ public function check(
156155
],
157156
'attribute',
158157
$attributeConstructor->acceptsNamedArguments(),
158+
$attributeConstructor,
159159
);
160160

161161
foreach ($parameterErrors as $error) {

src/Rules/Classes/InstantiationRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ private function checkClassName(string $class, bool $isName, Node $node, Scope $
192192
$classDisplayName = SprintfHelper::escapeFormatString($classReflection->getDisplayName());
193193

194194
return array_merge($messages, $this->check->check(
195-
$constructorReflection,
196195
ParametersAcceptorSelector::selectFromArgs(
197196
$scope,
198197
$node->getArgs(),
@@ -221,6 +220,7 @@ private function checkClassName(string $class, bool $isName, Node $node, Scope $
221220
],
222221
'new',
223222
$constructorReflection->acceptsNamedArguments(),
223+
$constructorReflection,
224224
));
225225
}
226226

src/Rules/FunctionCallParametersCheck.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@ public function __construct(
5656
}
5757

5858
/**
59-
* @param MethodReflection|FunctionReflection|null $callReflection
6059
* @param Node\Expr\FuncCall|Node\Expr\MethodCall|Node\Expr\StaticCall|Node\Expr\New_ $funcCall
6160
* @param array{0: string, 1: string, 2: string, 3: string, 4: string, 5: string, 6: string, 7: string, 8: string, 9: string, 10: string, 11: string, 12: string, 13?: string, 14?: string} $messages
6261
* @param 'attribute'|'callable'|'method'|'staticMethod'|'function'|'new' $nodeType
62+
* @param MethodReflection|FunctionReflection|null $callReflection
6363
* @return list<IdentifierRuleError>
6464
*/
6565
public function check(
66-
$callReflection,
6766
ParametersAcceptor $parametersAcceptor,
6867
Scope $scope,
6968
bool $isBuiltin,
7069
$funcCall,
7170
array $messages,
7271
string $nodeType = 'function',
7372
bool $acceptsNamedArguments = true,
73+
$callReflection = null,
7474
): array
7575
{
7676
$functionParametersMinCount = 0;

src/Rules/Functions/CallCallablesRule.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public function processNode(
113113
return array_merge(
114114
$messages,
115115
$this->check->check(
116-
null,
117116
$parametersAcceptor,
118117
$scope,
119118
false,

src/Rules/Functions/CallToFunctionParametersRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function processNode(Node $node, Scope $scope): array
4040
$functionName = SprintfHelper::escapeFormatString($function->getName());
4141

4242
return $this->check->check(
43-
$function,
4443
ParametersAcceptorSelector::selectFromArgs(
4544
$scope,
4645
$node->getArgs(),
@@ -69,6 +68,7 @@ public function processNode(Node $node, Scope $scope): array
6968
],
7069
'function',
7170
$function->acceptsNamedArguments(),
71+
$function,
7272
);
7373
}
7474

src/Rules/Functions/CallUserFuncRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function processNode(Node $node, Scope $scope): array
6060

6161
$callableDescription = 'callable passed to call_user_func()';
6262

63-
return $this->check->check(null, $parametersAcceptor, $scope, false, $funcCall, [
63+
return $this->check->check($parametersAcceptor, $scope, false, $funcCall, [
6464
ucfirst($callableDescription) . ' invoked with %d parameter, %d required.',
6565
ucfirst($callableDescription) . ' invoked with %d parameters, %d required.',
6666
ucfirst($callableDescription) . ' invoked with %d parameter, at least %d required.',

src/Rules/Methods/CallMethodsRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function processNode(Node $node, Scope $scope): array
4646
$messagesMethodName = SprintfHelper::escapeFormatString($declaringClass->getDisplayName() . '::' . $methodReflection->getName() . '()');
4747

4848
return array_merge($errors, $this->parametersCheck->check(
49-
$methodReflection,
5049
ParametersAcceptorSelector::selectFromArgs(
5150
$scope,
5251
$node->getArgs(),
@@ -75,6 +74,7 @@ public function processNode(Node $node, Scope $scope): array
7574
],
7675
'method',
7776
$methodReflection->acceptsNamedArguments(),
77+
$methodReflection,
7878
));
7979
}
8080

src/Rules/Methods/CallStaticMethodsRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function processNode(Node $node, Scope $scope): array
5454
));
5555

5656
$errors = array_merge($errors, $this->parametersCheck->check(
57-
$method,
5857
ParametersAcceptorSelector::selectFromArgs(
5958
$scope,
6059
$node->getArgs(),
@@ -83,6 +82,7 @@ public function processNode(Node $node, Scope $scope): array
8382
],
8483
'staticMethod',
8584
$method->acceptsNamedArguments(),
85+
$method,
8686
));
8787

8888
return $errors;

0 commit comments

Comments
 (0)