| Conditions | 5 |
| Paths | 9 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5.009 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 30 | public function load(array $configs, ContainerBuilder $container) |
|
| 14 | { |
||
| 15 | 30 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 16 | 30 | $loader->load('cruds.yml'); |
|
| 17 | |||
| 18 | 30 | $config = $this->processConfiguration($this->getConfiguration([], $container), $configs); |
|
|
|
|||
| 19 | |||
| 20 | 30 | $configurator = new CrudsEntitiesConfigurator($container); |
|
| 21 | 30 | $container->addObjectResource($configurator); |
|
| 22 | 30 | foreach ($config['entities'] as $name => $entityConfig) { |
|
| 23 | 30 | $entityConfig['prefix'] = $entityConfig['prefix'] ?: '/' . $name; |
|
| 24 | 30 | $configurator->processEntityConfiguration($name, $entityConfig); |
|
| 25 | } |
||
| 26 | |||
| 27 | 30 | foreach ($config['listeners'] as $listener => $enabled) { |
|
| 28 | 30 | if ($enabled) { |
|
| 29 | 30 | continue; |
|
| 30 | } |
||
| 31 | |||
| 32 | $container->removeDefinition('cruds.api.listener.' . $listener); |
||
| 33 | } |
||
| 34 | 30 | } |
|
| 35 | } |
||
| 36 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: