Skip to content

Commit

Permalink
Clean up parameters config
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 5, 2024
1 parent 0c7771b commit caa046b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 9 additions & 1 deletion extension.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
parameters:
doctrine:
reportDynamicQueryBuilders: false
reportUnknownTypes: false
allowNullablePropertyForRequiredField: false
repositoryClass: null
ormRepositoryClass: null
odmRepositoryClass: null
Expand All @@ -8,6 +11,7 @@ parameters:
objectManagerLoader: null
searchOtherMethodsForQueryBuilderBeginning: true
queryBuilderFastAlgorithm: false
literalString: false
featureToggles:
skipCheckGenericClasses:
- Doctrine\ODM\MongoDB\Mapping\ClassMetadata
Expand Down Expand Up @@ -75,6 +79,10 @@ parametersSchema:
objectManagerLoader: schema(string(), nullable())
searchOtherMethodsForQueryBuilderBeginning: bool()
queryBuilderFastAlgorithm: bool()
reportDynamicQueryBuilders: bool()
reportUnknownTypes: bool()
allowNullablePropertyForRequiredField: bool()
literalString: bool()
])

conditionalTags:
Expand Down Expand Up @@ -435,7 +443,7 @@ services:
-
class: PHPStan\PhpDoc\Doctrine\DoctrineLiteralStringTypeNodeResolverExtension
arguments:
bleedingEdge: %featureToggles.bleedingEdge%
enabled: %doctrine.literalString%
tags:
- phpstan.phpDoc.typeNodeResolverExtension

Expand Down
1 change: 1 addition & 0 deletions rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ parametersSchema:
reportDynamicQueryBuilders: bool()
reportUnknownTypes: bool()
allowNullablePropertyForRequiredField: bool()
literalString: bool()
])

rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(),
Expand Down

0 comments on commit caa046b

Please sign in to comment.