12
12
namespace Symfony \Component \DependencyInjection \Compiler ;
13
13
14
14
use Symfony \Component \Config \Resource \ClassExistenceResource ;
15
- use Symfony \Component \DependencyInjection \Argument \ServiceLocatorArgument ;
16
- use Symfony \Component \DependencyInjection \Argument \TaggedIteratorArgument ;
17
- use Symfony \Component \DependencyInjection \Attribute \TaggedIterator ;
18
- use Symfony \Component \DependencyInjection \Attribute \TaggedLocator ;
19
15
use Symfony \Component \DependencyInjection \Attribute \Target ;
20
16
use Symfony \Component \DependencyInjection \ContainerBuilder ;
21
17
use Symfony \Component \DependencyInjection \Definition ;
@@ -139,8 +135,7 @@ private function doProcessValue($value, bool $isRoot = false)
139
135
array_unshift ($ this ->methodCalls , [$ constructor , $ value ->getArguments ()]);
140
136
}
141
137
142
- $ checkAttributes = 80000 <= \PHP_VERSION_ID && !$ value ->hasTag ('container.ignore_attributes ' );
143
- $ this ->methodCalls = $ this ->autowireCalls ($ reflectionClass , $ isRoot , $ checkAttributes );
138
+ $ this ->methodCalls = $ this ->autowireCalls ($ reflectionClass , $ isRoot );
144
139
145
140
if ($ constructor ) {
146
141
[, $ arguments ] = array_shift ($ this ->methodCalls );
@@ -157,7 +152,7 @@ private function doProcessValue($value, bool $isRoot = false)
157
152
return $ value ;
158
153
}
159
154
160
- private function autowireCalls (\ReflectionClass $ reflectionClass , bool $ isRoot, bool $ checkAttributes ): array
155
+ private function autowireCalls (\ReflectionClass $ reflectionClass , bool $ isRoot ): array
161
156
{
162
157
$ this ->decoratedId = null ;
163
158
$ this ->decoratedClass = null ;
@@ -186,7 +181,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot,
186
181
}
187
182
}
188
183
189
- $ arguments = $ this ->autowireMethod ($ reflectionMethod , $ arguments , $ checkAttributes , $ i );
184
+ $ arguments = $ this ->autowireMethod ($ reflectionMethod , $ arguments , $ i );
190
185
191
186
if ($ arguments !== $ call [1 ]) {
192
187
$ this ->methodCalls [$ i ][1 ] = $ arguments ;
@@ -227,7 +222,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot,
227
222
*
228
223
* @throws AutowiringFailedException
229
224
*/
230
- private function autowireMethod (\ReflectionFunctionAbstract $ reflectionMethod , array $ arguments , bool $ checkAttributes , int $ methodIndex ): array
225
+ private function autowireMethod (\ReflectionFunctionAbstract $ reflectionMethod , array $ arguments , int $ methodIndex ): array
231
226
{
232
227
$ class = $ reflectionMethod instanceof \ReflectionMethod ? $ reflectionMethod ->class : $ this ->currentId ;
233
228
$ method = $ reflectionMethod ->name ;
@@ -246,26 +241,6 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
246
241
247
242
$ type = ProxyHelper::getTypeHint ($ reflectionMethod , $ parameter , true );
248
243
249
- if ($ checkAttributes ) {
250
- foreach ($ parameter ->getAttributes () as $ attribute ) {
251
- if (TaggedIterator::class === $ attribute ->getName ()) {
252
- $ attribute = $ attribute ->newInstance ();
253
- $ arguments [$ index ] = new TaggedIteratorArgument ($ attribute ->tag , $ attribute ->indexAttribute , $ attribute ->defaultIndexMethod , false , $ attribute ->defaultPriorityMethod );
254
- break ;
255
- }
256
-
257
- if (TaggedLocator::class === $ attribute ->getName ()) {
258
- $ attribute = $ attribute ->newInstance ();
259
- $ arguments [$ index ] = new ServiceLocatorArgument (new TaggedIteratorArgument ($ attribute ->tag , $ attribute ->indexAttribute , $ attribute ->defaultIndexMethod , true , $ attribute ->defaultPriorityMethod ));
260
- break ;
261
- }
262
- }
263
-
264
- if ('' !== ($ arguments [$ index ] ?? '' )) {
265
- continue ;
266
- }
267
- }
268
-
269
244
if (!$ type ) {
270
245
if (isset ($ arguments [$ index ])) {
271
246
continue ;
0 commit comments