1212namespace Symfony \Component \DependencyInjection \Compiler ;
1313
1414use 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 ;
1915use Symfony \Component \DependencyInjection \Attribute \Target ;
2016use Symfony \Component \DependencyInjection \ContainerBuilder ;
2117use Symfony \Component \DependencyInjection \Definition ;
@@ -139,8 +135,7 @@ private function doProcessValue($value, bool $isRoot = false)
139135 array_unshift ($ this ->methodCalls , [$ constructor , $ value ->getArguments ()]);
140136 }
141137
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 );
144139
145140 if ($ constructor ) {
146141 [, $ arguments ] = array_shift ($ this ->methodCalls );
@@ -157,7 +152,7 @@ private function doProcessValue($value, bool $isRoot = false)
157152 return $ value ;
158153 }
159154
160- private function autowireCalls (\ReflectionClass $ reflectionClass , bool $ isRoot, bool $ checkAttributes ): array
155+ private function autowireCalls (\ReflectionClass $ reflectionClass , bool $ isRoot ): array
161156 {
162157 $ this ->decoratedId = null ;
163158 $ this ->decoratedClass = null ;
@@ -186,7 +181,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot,
186181 }
187182 }
188183
189- $ arguments = $ this ->autowireMethod ($ reflectionMethod , $ arguments , $ checkAttributes , $ i );
184+ $ arguments = $ this ->autowireMethod ($ reflectionMethod , $ arguments , $ i );
190185
191186 if ($ arguments !== $ call [1 ]) {
192187 $ this ->methodCalls [$ i ][1 ] = $ arguments ;
@@ -227,7 +222,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot,
227222 *
228223 * @throws AutowiringFailedException
229224 */
230- private function autowireMethod (\ReflectionFunctionAbstract $ reflectionMethod , array $ arguments , bool $ checkAttributes , int $ methodIndex ): array
225+ private function autowireMethod (\ReflectionFunctionAbstract $ reflectionMethod , array $ arguments , int $ methodIndex ): array
231226 {
232227 $ class = $ reflectionMethod instanceof \ReflectionMethod ? $ reflectionMethod ->class : $ this ->currentId ;
233228 $ method = $ reflectionMethod ->name ;
@@ -246,26 +241,6 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
246241
247242 $ type = ProxyHelper::getTypeHint ($ reflectionMethod , $ parameter , true );
248243
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-
269244 if (!$ type ) {
270245 if (isset ($ arguments [$ index ])) {
271246 continue ;
0 commit comments