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