Skip to content

Commit cefb24b

Browse files
Use var with comment
1 parent fc59c3b commit cefb24b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Rules/FunctionCallParametersCheck.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ public function check(
363363
!$parameter->passedByReference()->createsNewVariable()
364364
|| (!$isBuiltin && !$argumentValueType instanceof ErrorType)
365365
) {
366-
$accepts = $this->ruleLevelHelper->accepts($parameterType, $argumentValueType, $scope->isDeclareStrictTypes() && !($isBuiltin && $parameterType->isCallable()->yes()));
366+
// @see https://github.com/php/php-src/issues/21568#issuecomment-4148832540
367+
$isStrictTypes = $scope->isDeclareStrictTypes()
368+
&& (!$isBuiltin || !$parameterType->isCallable()->yes());
369+
$accepts = $this->ruleLevelHelper->accepts($parameterType, $argumentValueType, $isStrictTypes);
367370

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

0 commit comments

Comments
 (0)