Skip to content

Commit fc59c3b

Browse files
phpstan-botclaude
andcommitted
Simplify callable strict types check to one-liner
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 627c741 commit fc59c3b

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/Rules/FunctionCallParametersCheck.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,7 @@ public function check(
363363
!$parameter->passedByReference()->createsNewVariable()
364364
|| (!$isBuiltin && !$argumentValueType instanceof ErrorType)
365365
) {
366-
$callableStrictTypes = $scope->isDeclareStrictTypes();
367-
if ($isBuiltin && $parameterType->isCallable()->yes()) {
368-
$callableStrictTypes = false;
369-
}
370-
$accepts = $this->ruleLevelHelper->accepts($parameterType, $argumentValueType, $callableStrictTypes);
366+
$accepts = $this->ruleLevelHelper->accepts($parameterType, $argumentValueType, $scope->isDeclareStrictTypes() && !($isBuiltin && $parameterType->isCallable()->yes()));
371367

372368
if (!$accepts->result) {
373369
$verbosityLevel = VerbosityLevel::getRecommendedLevelByType($parameterType, $argumentValueType);

0 commit comments

Comments
 (0)