Skip to content

Commit

Permalink
Ignore some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Nov 12, 2024
1 parent 92438b0 commit 108a329
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/PHPStan/PregMatchTypeSpecifyingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,26 @@ public function specifyTypes(MethodReflection $methodReflection, StaticCall $nod
$context = $context->negate();
}

// @phpstan-ignore function.alreadyNarrowedType, function.impossibleType
if (method_exists('PHPStan\Analyser\SpecifiedTypes', 'setRootExpr')) {
// @phpstan-ignore method.notFound
$typeSpecifier = $this->typeSpecifier->create(
$matchesArg->value,
$matchedType,
$context,
// @phpstan-ignore argument.type
$scope
)->setRootExpr($node);

return $overwrite ? $typeSpecifier->setAlwaysOverwriteTypes() : $typeSpecifier;
}

// @phpstan-ignore arguments.count
return $this->typeSpecifier->create(
$matchesArg->value,
$matchedType,
$context,
// @phpstan-ignore argument.type
$overwrite,
$scope,
$node
Expand Down

0 comments on commit 108a329

Please sign in to comment.