| Conditions | 4 |
| Paths | 5 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4.0466 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 3 | public function process(ContainerBuilder $container) |
|
| 19 | { |
||
| 20 | 3 | $bundles = $container->getParameter('enum.register_bundles'); |
|
| 21 | |||
| 22 | 3 | if (!$bundles) { |
|
| 23 | return; |
||
| 24 | } |
||
| 25 | |||
| 26 | 3 | @trigger_error( |
|
|
|
|||
| 27 | 3 | '"' . __CLASS__ . '" is deprecated since v2.2. Please use Symfony\'s PSR4 Service discovery instead.', |
|
| 28 | 3 | E_USER_DEPRECATED |
|
| 29 | ); |
||
| 30 | |||
| 31 | 3 | if (true === $bundles) { |
|
| 32 | $bundles = $container->getParameter('kernel.bundles'); |
||
| 33 | } else { |
||
| 34 | 3 | $bundles = (array) $bundles; |
|
| 35 | } |
||
| 36 | |||
| 37 | 3 | foreach ($bundles as $bundleClass) { |
|
| 38 | 3 | $declarativePass = new DeclarativeEnumCollectorCompilerPass($bundleClass); |
|
| 39 | 3 | $declarativePass->process($container); |
|
| 40 | } |
||
| 41 | 3 | } |
|
| 42 | } |
||
| 43 |
If you suppress an error, we recommend checking for the error condition explicitly: