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 ;
@@ -135,8 +131,7 @@ private function doProcessValue($value, bool $isRoot = false)
135
131
array_unshift ($ this ->methodCalls , [$ constructor , $ value ->getArguments ()]);
136
132
}
137
133
138
- $ checkAttributes = 80000 <= \PHP_VERSION_ID && !$ value ->hasTag ('container.ignore_attributes ' );
139
- $ this ->methodCalls = $ this ->autowireCalls ($ reflectionClass , $ isRoot , $ checkAttributes );
134
+ $ this ->methodCalls = $ this ->autowireCalls ($ reflectionClass , $ isRoot );
140
135
141
136
if ($ constructor ) {
142
137
[, $ arguments ] = array_shift ($ this ->methodCalls );
@@ -153,7 +148,7 @@ private function doProcessValue($value, bool $isRoot = false)
153
148
return $ value ;
154
149
}
155
150
156
- private function autowireCalls (\ReflectionClass $ reflectionClass , bool $ isRoot, bool $ checkAttributes ): array
151
+ private function autowireCalls (\ReflectionClass $ reflectionClass , bool $ isRoot ): array
157
152
{
158
153
$ this ->decoratedId = null ;
159
154
$ this ->decoratedClass = null ;
@@ -182,7 +177,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot,
182
177
}
183
178
}
184
179
185
- $ arguments = $ this ->autowireMethod ($ reflectionMethod , $ arguments , $ checkAttributes , $ i );
180
+ $ arguments = $ this ->autowireMethod ($ reflectionMethod , $ arguments , $ i );
186
181
187
182
if ($ arguments !== $ call [1 ]) {
188
183
$ this ->methodCalls [$ i ][1 ] = $ arguments ;
@@ -225,7 +220,7 @@ private function autowireCalls(\ReflectionClass $reflectionClass, bool $isRoot,
225
220
*
226
221
* @throws AutowiringFailedException
227
222
*/
228
- private function autowireMethod (\ReflectionFunctionAbstract $ reflectionMethod , array $ arguments , bool $ checkAttributes , int $ methodIndex ): array
223
+ private function autowireMethod (\ReflectionFunctionAbstract $ reflectionMethod , array $ arguments , int $ methodIndex ): array
229
224
{
230
225
$ class = $ reflectionMethod instanceof \ReflectionMethod ? $ reflectionMethod ->class : $ this ->currentId ;
231
226
$ method = $ reflectionMethod ->name ;
@@ -244,26 +239,6 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
244
239
245
240
$ type = ProxyHelper::getTypeHint ($ reflectionMethod , $ parameter , true );
246
241
247
- if ($ checkAttributes ) {
248
- foreach ($ parameter ->getAttributes () as $ attribute ) {
249
- if (TaggedIterator::class === $ attribute ->getName ()) {
250
- $ attribute = $ attribute ->newInstance ();
251
- $ arguments [$ index ] = new TaggedIteratorArgument ($ attribute ->tag , $ attribute ->indexAttribute );
252
- break ;
253
- }
254
-
255
- if (TaggedLocator::class === $ attribute ->getName ()) {
256
- $ attribute = $ attribute ->newInstance ();
257
- $ arguments [$ index ] = new ServiceLocatorArgument (new TaggedIteratorArgument ($ attribute ->tag , $ attribute ->indexAttribute , null , true ));
258
- break ;
259
- }
260
- }
261
-
262
- if ('' !== ($ arguments [$ index ] ?? '' )) {
263
- continue ;
264
- }
265
- }
266
-
267
242
if (!$ type ) {
268
243
if (isset ($ arguments [$ index ])) {
269
244
continue ;
0 commit comments