From bd2cec118592f7c66dff5a7ae28882654daf6468 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 1 Aug 2024 09:43:09 +0200 Subject: [PATCH] Precise type for `$matches` from `preg_match` generally available, out of bleeding edge --- conf/bleedingEdge.neon | 1 - conf/config.neon | 15 ++++++++++----- conf/parametersSchema.neon | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/conf/bleedingEdge.neon b/conf/bleedingEdge.neon index 61482ac786..b95ba0e92e 100644 --- a/conf/bleedingEdge.neon +++ b/conf/bleedingEdge.neon @@ -54,7 +54,6 @@ parameters: paramOutType: true pure: true checkParameterCastableToStringFunctions: true - narrowPregMatches: true uselessReturnValue: true printfArrayParameters: true preciseMissingReturn: true diff --git a/conf/config.neon b/conf/config.neon index 2f5371bbfb..df10aa7d4b 100644 --- a/conf/config.neon +++ b/conf/config.neon @@ -89,7 +89,6 @@ parameters: paramOutType: false pure: false checkParameterCastableToStringFunctions: false - narrowPregMatches: false uselessReturnValue: false printfArrayParameters: false preciseMissingReturn: false @@ -290,10 +289,6 @@ conditionalTags: phpstan.parser.richParserNodeVisitor: %featureToggles.curlSetOptTypes% PHPStan\Parser\TypeTraverserInstanceofVisitor: phpstan.parser.richParserNodeVisitor: %featureToggles.instanceofType% - PHPStan\Type\Php\PregMatchTypeSpecifyingExtension: - phpstan.typeSpecifier.functionTypeSpecifyingExtension: %featureToggles.narrowPregMatches% - PHPStan\Type\Php\PregMatchParameterOutTypeExtension: - phpstan.functionParameterOutTypeExtension: %featureToggles.narrowPregMatches% services: - @@ -1491,6 +1486,16 @@ services: - class: PHPStan\Type\Php\PregMatchTypeSpecifyingExtension + - + class: PHPStan\Type\Php\PregMatchTypeSpecifyingExtension + tags: + - phpstan.typeSpecifier.functionTypeSpecifyingExtension + + - + class: PHPStan\Type\Php\PregMatchParameterOutTypeExtension + tags: + - phpstan.functionParameterOutTypeExtension + - class: PHPStan\Type\Php\PregMatchParameterOutTypeExtension diff --git a/conf/parametersSchema.neon b/conf/parametersSchema.neon index 94984336fa..ea4aa61efd 100644 --- a/conf/parametersSchema.neon +++ b/conf/parametersSchema.neon @@ -84,7 +84,6 @@ parametersSchema: paramOutType: bool() pure: bool() checkParameterCastableToStringFunctions: bool() - narrowPregMatches: bool() uselessReturnValue: bool() printfArrayParameters: bool() preciseMissingReturn: bool()