Skip to content

Commit

Permalink
Add doctrineTypeDescriptorRegistry service
Browse files Browse the repository at this point in the history
This allows to override the DescriptorRegistry to modify it to your own needs.
  • Loading branch information
ruudk authored and ondrejmirtes committed Jan 5, 2024
1 parent a54c92b commit 9123dc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ conditionalTags:
services:
-
class: PHPStan\Type\Doctrine\DescriptorRegistryFactory
-

doctrineTypeDescriptorRegistry:
class: PHPStan\Type\Doctrine\DefaultDescriptorRegistry
factory: @PHPStan\Type\Doctrine\DescriptorRegistryFactory::createRegistry

Expand Down Expand Up @@ -115,6 +116,7 @@ services:
arguments:
queryBuilderClass: %doctrine.queryBuilderClass%
argumentsProcessor: @doctrineQueryBuilderArgumentsProcessor
descriptorRegistry: @doctrineTypeDescriptorRegistry
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
Expand All @@ -138,6 +140,7 @@ services:
class: PHPStan\Type\Doctrine\CreateQueryDynamicReturnTypeExtension
arguments:
objectMetadataResolver: @PHPStan\Type\Doctrine\ObjectMetadataResolver
descriptorRegistry: @doctrineTypeDescriptorRegistry
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
Expand Down
1 change: 1 addition & 0 deletions rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ services:
reportUnknownTypes: %doctrine.reportUnknownTypes%
allowNullablePropertyForRequiredField: %doctrine.allowNullablePropertyForRequiredField%
bleedingEdge: %featureToggles.bleedingEdge%
descriptorRegistry: @doctrineTypeDescriptorRegistry
tags:
- phpstan.rules.rule
-
Expand Down

0 comments on commit 9123dc5

Please sign in to comment.