Conditions | 6 |
Paths | 4 |
Total Lines | 28 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
||
12 | { |
||
13 | /** @var array $config */ |
||
14 | $config = $container->get('config'); |
||
15 | |||
16 | $binaryOptions = []; |
||
17 | if (isset($config['rvdlee']['zf-image-optimiser'][$requestedName]['binary-options'])) { |
||
18 | $binaryOptions = $config['rvdlee']['zf-image-optimiser'][$requestedName]['binary-options']; |
||
19 | } |
||
20 | |||
21 | $validatorChain = []; |
||
22 | if (isset($config['rvdlee']['zf-image-optimiser'][$requestedName]['validator-chain'])) { |
||
23 | $validatorChainConfigs = $config['rvdlee']['zf-image-optimiser'][$requestedName]['validator-chain']; |
||
24 | |||
25 | $validatorChain = new ValidatorChain(); |
||
26 | /** @var array $validatorChainConfig */ |
||
27 | foreach ($validatorChainConfigs as $validatorChainConfig) { |
||
28 | if (class_exists($validatorChainConfig['name'])) { |
||
29 | $validatorConfig = isset($validatorChainConfig['options']) ? $validatorChainConfig['options'] : []; |
||
30 | $validator = new $validatorChainConfig['name']($validatorConfig); |
||
31 | $validatorChain->attach($validator); |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 | |||
36 | return [ |
||
|
|||
37 | $binaryOptions, |
||
38 | $validatorChain |
||
39 | ]; |
||
41 | } |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: