4
4
5
5
use Nette \DI \CompilerExtension ;
6
6
use olvlvl \ComposerAttributeCollector \Attributes ;
7
+ use PHPStan \Analyser \ResultCache \ResultCacheMetaExtension ;
8
+ use PHPStan \Analyser \TypeSpecifierFactory ;
7
9
use PHPStan \Broker \BrokerFactory ;
10
+ use PHPStan \DependencyInjection \Type \LazyDynamicThrowTypeExtensionProvider ;
11
+ use PHPStan \DependencyInjection \Type \LazyParameterClosureTypeExtensionProvider ;
12
+ use PHPStan \DependencyInjection \Type \LazyParameterOutTypeExtensionProvider ;
13
+ use PHPStan \PhpDoc \StubFilesExtension ;
14
+ use PHPStan \PhpDoc \TypeNodeResolverExtension ;
15
+ use PHPStan \Reflection \AllowedSubTypesClassReflectionExtension ;
16
+ use PHPStan \Reflection \Deprecation \ClassConstantDeprecationExtension ;
17
+ use PHPStan \Reflection \Deprecation \ClassDeprecationExtension ;
18
+ use PHPStan \Reflection \Deprecation \EnumCaseDeprecationExtension ;
19
+ use PHPStan \Reflection \Deprecation \FunctionDeprecationExtension ;
20
+ use PHPStan \Reflection \Deprecation \MethodDeprecationExtension ;
21
+ use PHPStan \Reflection \Deprecation \PropertyDeprecationExtension ;
22
+ use PHPStan \Reflection \MethodsClassReflectionExtension ;
23
+ use PHPStan \Reflection \PropertiesClassReflectionExtension ;
24
+ use PHPStan \Rules \Constants \AlwaysUsedClassConstantsExtensionProvider ;
8
25
use PHPStan \Rules \LazyRegistry ;
26
+ use PHPStan \Rules \Properties \ReadWritePropertiesExtensionProvider ;
27
+ use PHPStan \Rules \RestrictedUsage \RestrictedClassConstantUsageExtension ;
28
+ use PHPStan \Rules \RestrictedUsage \RestrictedClassNameUsageExtension ;
29
+ use PHPStan \Rules \RestrictedUsage \RestrictedFunctionUsageExtension ;
30
+ use PHPStan \Rules \RestrictedUsage \RestrictedMethodUsageExtension ;
31
+ use PHPStan \Rules \RestrictedUsage \RestrictedPropertyUsageExtension ;
9
32
use PHPStan \Rules \Rule ;
10
33
use PHPStan \Type \DynamicFunctionReturnTypeExtension ;
34
+ use PHPStan \Type \DynamicFunctionThrowTypeExtension ;
35
+ use PHPStan \Type \DynamicMethodReturnTypeExtension ;
36
+ use PHPStan \Type \DynamicMethodThrowTypeExtension ;
37
+ use PHPStan \Type \DynamicStaticMethodReturnTypeExtension ;
38
+ use PHPStan \Type \DynamicStaticMethodThrowTypeExtension ;
39
+ use PHPStan \Type \ExpressionTypeResolverExtension ;
40
+ use PHPStan \Type \FunctionParameterClosureTypeExtension ;
41
+ use PHPStan \Type \FunctionParameterOutTypeExtension ;
42
+ use PHPStan \Type \FunctionTypeSpecifyingExtension ;
43
+ use PHPStan \Type \MethodParameterClosureTypeExtension ;
44
+ use PHPStan \Type \MethodParameterOutTypeExtension ;
45
+ use PHPStan \Type \MethodTypeSpecifyingExtension ;
46
+ use PHPStan \Type \OperatorTypeSpecifyingExtension ;
47
+ use PHPStan \Type \StaticMethodParameterClosureTypeExtension ;
48
+ use PHPStan \Type \StaticMethodParameterOutTypeExtension ;
49
+ use PHPStan \Type \StaticMethodTypeSpecifyingExtension ;
11
50
use ReflectionClass ;
12
51
13
52
final class AutowiredAttributeServicesExtension extends CompilerExtension
@@ -20,8 +59,44 @@ public function loadConfiguration(): void
20
59
$ builder = $ this ->getContainerBuilder ();
21
60
22
61
$ interfaceToTag = [
62
+ PropertiesClassReflectionExtension::class => BrokerFactory::PROPERTIES_CLASS_REFLECTION_EXTENSION_TAG ,
63
+ MethodsClassReflectionExtension::class => BrokerFactory::METHODS_CLASS_REFLECTION_EXTENSION_TAG ,
64
+ AllowedSubTypesClassReflectionExtension::class => BrokerFactory::ALLOWED_SUB_TYPES_CLASS_REFLECTION_EXTENSION_TAG ,
65
+ DynamicMethodReturnTypeExtension::class => BrokerFactory::DYNAMIC_METHOD_RETURN_TYPE_EXTENSION_TAG ,
66
+ DynamicStaticMethodReturnTypeExtension::class => BrokerFactory::DYNAMIC_STATIC_METHOD_RETURN_TYPE_EXTENSION_TAG ,
23
67
DynamicFunctionReturnTypeExtension::class => BrokerFactory::DYNAMIC_FUNCTION_RETURN_TYPE_EXTENSION_TAG ,
68
+ OperatorTypeSpecifyingExtension::class => BrokerFactory::OPERATOR_TYPE_SPECIFYING_EXTENSION_TAG ,
69
+ ExpressionTypeResolverExtension::class => BrokerFactory::EXPRESSION_TYPE_RESOLVER_EXTENSION_TAG ,
70
+ TypeNodeResolverExtension::class => TypeNodeResolverExtension::EXTENSION_TAG ,
24
71
Rule::class => LazyRegistry::RULE_TAG ,
72
+ StubFilesExtension::class => StubFilesExtension::EXTENSION_TAG ,
73
+ AlwaysUsedClassConstantsExtensionProvider::class => AlwaysUsedClassConstantsExtensionProvider::EXTENSION_TAG ,
74
+ ReadWritePropertiesExtensionProvider::class => ReadWritePropertiesExtensionProvider::EXTENSION_TAG ,
75
+ FunctionTypeSpecifyingExtension::class => TypeSpecifierFactory::FUNCTION_TYPE_SPECIFYING_EXTENSION_TAG ,
76
+ MethodTypeSpecifyingExtension::class => TypeSpecifierFactory::METHOD_TYPE_SPECIFYING_EXTENSION_TAG ,
77
+ StaticMethodTypeSpecifyingExtension::class => TypeSpecifierFactory::STATIC_METHOD_TYPE_SPECIFYING_EXTENSION_TAG ,
78
+ DynamicFunctionThrowTypeExtension::class => LazyDynamicThrowTypeExtensionProvider::FUNCTION_TAG ,
79
+ DynamicMethodThrowTypeExtension::class => LazyDynamicThrowTypeExtensionProvider::METHOD_TAG ,
80
+ DynamicStaticMethodThrowTypeExtension::class => LazyDynamicThrowTypeExtensionProvider::STATIC_METHOD_TAG ,
81
+ FunctionParameterClosureTypeExtension::class => LazyParameterClosureTypeExtensionProvider::FUNCTION_TAG ,
82
+ MethodParameterClosureTypeExtension::class => LazyParameterClosureTypeExtensionProvider::METHOD_TAG ,
83
+ StaticMethodParameterClosureTypeExtension::class => LazyParameterClosureTypeExtensionProvider::STATIC_METHOD_TAG ,
84
+ FunctionParameterOutTypeExtension::class => LazyParameterOutTypeExtensionProvider::FUNCTION_TAG ,
85
+ MethodParameterOutTypeExtension::class => LazyParameterOutTypeExtensionProvider::METHOD_TAG ,
86
+ StaticMethodParameterOutTypeExtension::class => LazyParameterOutTypeExtensionProvider::STATIC_METHOD_TAG ,
87
+ ResultCacheMetaExtension::class => ResultCacheMetaExtension::EXTENSION_TAG ,
88
+ ClassConstantDeprecationExtension::class => ClassConstantDeprecationExtension::CLASS_CONSTANT_EXTENSION_TAG ,
89
+ ClassDeprecationExtension::class => ClassDeprecationExtension::CLASS_EXTENSION_TAG ,
90
+ EnumCaseDeprecationExtension::class => EnumCaseDeprecationExtension::ENUM_CASE_EXTENSION_TAG ,
91
+ FunctionDeprecationExtension::class => FunctionDeprecationExtension::FUNCTION_EXTENSION_TAG ,
92
+ MethodDeprecationExtension::class => MethodDeprecationExtension::METHOD_EXTENSION_TAG ,
93
+ PropertyDeprecationExtension::class => PropertyDeprecationExtension::PROPERTY_EXTENSION_TAG ,
94
+ RestrictedMethodUsageExtension::class => RestrictedMethodUsageExtension::METHOD_EXTENSION_TAG ,
95
+ RestrictedClassNameUsageExtension::class => RestrictedClassNameUsageExtension::CLASS_NAME_EXTENSION_TAG ,
96
+ RestrictedFunctionUsageExtension::class => RestrictedFunctionUsageExtension::FUNCTION_EXTENSION_TAG ,
97
+ RestrictedPropertyUsageExtension::class => RestrictedPropertyUsageExtension::PROPERTY_EXTENSION_TAG ,
98
+ RestrictedClassConstantUsageExtension::class => RestrictedClassConstantUsageExtension::CLASS_CONSTANT_EXTENSION_TAG ,
99
+
25
100
];
26
101
27
102
foreach ($ autowiredServiceClasses as $ class ) {
0 commit comments