Skip to content

Commit 9123dc5

Browse files
ruudkondrejmirtes
authored andcommitted
Add doctrineTypeDescriptorRegistry service
This allows to override the DescriptorRegistry to modify it to your own needs.
1 parent a54c92b commit 9123dc5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

extension.neon

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ conditionalTags:
7474
services:
7575
-
7676
class: PHPStan\Type\Doctrine\DescriptorRegistryFactory
77-
-
77+
78+
doctrineTypeDescriptorRegistry:
7879
class: PHPStan\Type\Doctrine\DefaultDescriptorRegistry
7980
factory: @PHPStan\Type\Doctrine\DescriptorRegistryFactory::createRegistry
8081

@@ -115,6 +116,7 @@ services:
115116
arguments:
116117
queryBuilderClass: %doctrine.queryBuilderClass%
117118
argumentsProcessor: @doctrineQueryBuilderArgumentsProcessor
119+
descriptorRegistry: @doctrineTypeDescriptorRegistry
118120
tags:
119121
- phpstan.broker.dynamicMethodReturnTypeExtension
120122
-
@@ -138,6 +140,7 @@ services:
138140
class: PHPStan\Type\Doctrine\CreateQueryDynamicReturnTypeExtension
139141
arguments:
140142
objectMetadataResolver: @PHPStan\Type\Doctrine\ObjectMetadataResolver
143+
descriptorRegistry: @doctrineTypeDescriptorRegistry
141144
tags:
142145
- phpstan.broker.dynamicMethodReturnTypeExtension
143146
-

rules.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ services:
4444
reportUnknownTypes: %doctrine.reportUnknownTypes%
4545
allowNullablePropertyForRequiredField: %doctrine.allowNullablePropertyForRequiredField%
4646
bleedingEdge: %featureToggles.bleedingEdge%
47+
descriptorRegistry: @doctrineTypeDescriptorRegistry
4748
tags:
4849
- phpstan.rules.rule
4950
-

0 commit comments

Comments
 (0)