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