From caa046bd6152818e781260fb3a7a96d6b0fadeed Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Mon, 5 Aug 2024 15:40:25 +0200 Subject: [PATCH] Clean up parameters config --- extension.neon | 10 +++++++++- rules.neon | 1 + .../DoctrineLiteralStringTypeNodeResolverExtension.php | 8 ++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/extension.neon b/extension.neon index 84bc0d04..fc7ad592 100644 --- a/extension.neon +++ b/extension.neon @@ -1,5 +1,8 @@ parameters: doctrine: + reportDynamicQueryBuilders: false + reportUnknownTypes: false + allowNullablePropertyForRequiredField: false repositoryClass: null ormRepositoryClass: null odmRepositoryClass: null @@ -8,6 +11,7 @@ parameters: objectManagerLoader: null searchOtherMethodsForQueryBuilderBeginning: true queryBuilderFastAlgorithm: false + literalString: false featureToggles: skipCheckGenericClasses: - Doctrine\ODM\MongoDB\Mapping\ClassMetadata @@ -75,6 +79,10 @@ parametersSchema: objectManagerLoader: schema(string(), nullable()) searchOtherMethodsForQueryBuilderBeginning: bool() queryBuilderFastAlgorithm: bool() + reportDynamicQueryBuilders: bool() + reportUnknownTypes: bool() + allowNullablePropertyForRequiredField: bool() + literalString: bool() ]) conditionalTags: @@ -435,7 +443,7 @@ services: - class: PHPStan\PhpDoc\Doctrine\DoctrineLiteralStringTypeNodeResolverExtension arguments: - bleedingEdge: %featureToggles.bleedingEdge% + enabled: %doctrine.literalString% tags: - phpstan.phpDoc.typeNodeResolverExtension diff --git a/rules.neon b/rules.neon index feb41184..de338d2a 100644 --- a/rules.neon +++ b/rules.neon @@ -17,6 +17,7 @@ parametersSchema: reportDynamicQueryBuilders: bool() reportUnknownTypes: bool() allowNullablePropertyForRequiredField: bool() + literalString: bool() ]) rules: diff --git a/src/PhpDoc/Doctrine/DoctrineLiteralStringTypeNodeResolverExtension.php b/src/PhpDoc/Doctrine/DoctrineLiteralStringTypeNodeResolverExtension.php index ce73011e..3aa371d5 100644 --- a/src/PhpDoc/Doctrine/DoctrineLiteralStringTypeNodeResolverExtension.php +++ b/src/PhpDoc/Doctrine/DoctrineLiteralStringTypeNodeResolverExtension.php @@ -15,11 +15,11 @@ class DoctrineLiteralStringTypeNodeResolverExtension implements TypeNodeResolver { /** @var bool */ - private $bleedingEdge; + private $enabled; - public function __construct(bool $bleedingEdge) + public function __construct(bool $enabled) { - $this->bleedingEdge = $bleedingEdge; + $this->enabled = $enabled; } public function resolve(TypeNode $typeNode, NameScope $nameScope): ?Type @@ -32,7 +32,7 @@ public function resolve(TypeNode $typeNode, NameScope $nameScope): ?Type return null; } - if ($this->bleedingEdge) { + if ($this->enabled) { return new IntersectionType([ new StringType(), new AccessoryLiteralStringType(),