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