53
53
use Symfony \Component \Messenger \Bridge \Doctrine \Transport \DoctrineTransportFactory ;
54
54
use Symfony \Component \Messenger \MessageBusInterface ;
55
55
56
+ use function array_map ;
56
57
use function array_values ;
57
58
use function class_exists ;
58
59
use function in_array ;
@@ -1195,7 +1196,10 @@ public function testEntityAttributeExcludesFromContainer(string $class)
1195
1196
1196
1197
$ extension ->load ([$ config ], $ container );
1197
1198
1198
- $ attributes = $ container ->getAutoconfiguredAttributes ();
1199
+ /** @phpstan-ignore function.alreadyNarrowedType */
1200
+ $ attributes = method_exists ($ container , 'getAttributeAutoconfigurators ' )
1201
+ ? array_map (static fn (array $ arr ) => $ arr [0 ], $ container ->getAttributeAutoconfigurators ())
1202
+ : $ container ->getAutoconfiguredAttributes ();
1199
1203
$ this ->assertInstanceOf (Closure::class, $ attributes [$ class ]);
1200
1204
1201
1205
$ definition = new ChildDefinition ('' );
@@ -1221,7 +1225,10 @@ public function testAsEntityListenerAttribute()
1221
1225
1222
1226
$ extension ->load ([$ config ], $ container );
1223
1227
1224
- $ attributes = $ container ->getAutoconfiguredAttributes ();
1228
+ /** @phpstan-ignore function.alreadyNarrowedType */
1229
+ $ attributes = method_exists ($ container , 'getAttributeAutoconfigurators ' )
1230
+ ? array_map (static fn (array $ arr ) => $ arr [0 ], $ container ->getAttributeAutoconfigurators ())
1231
+ : $ container ->getAutoconfiguredAttributes ();
1225
1232
$ this ->assertInstanceOf (Closure::class, $ attributes [AsEntityListener::class]);
1226
1233
1227
1234
$ reflector = new ReflectionClass (Php8EntityListener::class);
@@ -1257,7 +1264,10 @@ public function testAsDoctrineListenerAttribute()
1257
1264
1258
1265
$ extension ->load ([$ config ], $ container );
1259
1266
1260
- $ attributes = $ container ->getAutoconfiguredAttributes ();
1267
+ /** @phpstan-ignore function.alreadyNarrowedType */
1268
+ $ attributes = method_exists ($ container , 'getAttributeAutoconfigurators ' )
1269
+ ? array_map (static fn (array $ arr ) => $ arr [0 ], $ container ->getAttributeAutoconfigurators ())
1270
+ : $ container ->getAutoconfiguredAttributes ();
1261
1271
$ this ->assertInstanceOf (Closure::class, $ attributes [AsDoctrineListener::class]);
1262
1272
1263
1273
$ reflector = new ReflectionClass (Php8EventListener::class);
0 commit comments