|
11 | 11 |
|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor;
|
13 | 13 |
|
| 14 | +use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\FooUnitEnum; |
| 15 | +use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Suit; |
14 | 16 | use Symfony\Component\DependencyInjection\Alias;
|
15 | 17 | use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
|
16 | 18 | use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
@@ -62,14 +64,26 @@ public static function getRoutes()
|
62 | 64 |
|
63 | 65 | public static function getContainerParameters()
|
64 | 66 | {
|
65 |
| - return [ |
66 |
| - 'parameters_1' => new ParameterBag([ |
67 |
| - 'integer' => 12, |
68 |
| - 'string' => 'Hello world!', |
69 |
| - 'boolean' => true, |
70 |
| - 'array' => [12, 'Hello world!', true], |
71 |
| - ]), |
72 |
| - ]; |
| 67 | + yield 'parameters_1' => new ParameterBag([ |
| 68 | + 'integer' => 12, |
| 69 | + 'string' => 'Hello world!', |
| 70 | + 'boolean' => true, |
| 71 | + 'array' => [12, 'Hello world!', true], |
| 72 | + ]); |
| 73 | + |
| 74 | + if (\PHP_VERSION_ID < 80100) { |
| 75 | + return; |
| 76 | + } |
| 77 | + |
| 78 | + yield 'parameters_enums' => new ParameterBag([ |
| 79 | + 'unit_enum' => FooUnitEnum::BAR, |
| 80 | + 'backed_enum' => Suit::Hearts, |
| 81 | + 'array_of_enums' => Suit::cases(), |
| 82 | + 'map' => [ |
| 83 | + 'mixed' => [Suit::Hearts, FooUnitEnum::BAR], |
| 84 | + 'single' => FooUnitEnum::BAR, |
| 85 | + ], |
| 86 | + ]); |
73 | 87 | }
|
74 | 88 |
|
75 | 89 | public static function getContainerParameter()
|
|
0 commit comments