| Conditions | 2 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2.5 |
| Changes | 11 | ||
| Bugs | 0 | Features | 6 |
| 1 | <?php |
||
| 19 | public function process(ContainerBuilder $container) |
||
| 20 | { |
||
| 21 | $redis = $container->getDefinition('redis'); |
||
| 22 | 3 | ||
| 23 | $masterArguments = $this->getArguments($container, ''); |
||
| 24 | 3 | ||
| 25 | try { |
||
| 26 | 3 | $slaveArguments = $this->getArguments($container, '.slave'); |
|
| 27 | $parameters = [$masterArguments, $slaveArguments]; |
||
| 28 | $options = ['replication' => true]; |
||
| 29 | 3 | ||
| 30 | $redis->setArguments([$parameters, $options]); |
||
| 31 | } catch (ParameterNotFoundException $e) { |
||
| 32 | // master only |
||
| 33 | $redis->setArguments([$masterArguments]); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 47 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.