| Conditions | 5 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | protected function createSingleClients(array $servers, array $options = []) |
||
| 21 | { |
||
| 22 | $clients = []; |
||
| 23 | |||
| 24 | foreach ($servers as $key => $server) { |
||
| 25 | $options = array_merge($options, Arr::pull($server, 'options')); |
||
| 26 | |||
| 27 | $clients[$key] = new Client($server, $options); |
||
| 28 | |||
| 29 | if (isset($options['update_sentinels']) && boolval($options['update_sentinels']) === true) { |
||
| 30 | /** @var ConnectionInterface $connection */ |
||
| 31 | $connection = ($clients[$key])->getConnection(); |
||
| 32 | |||
| 33 | if ($connection instanceof SentinelReplication) { |
||
| 34 | // is not defined on the interface so make sure we've got the right thing. |
||
| 35 | $connection->setUpdateSentinels(true); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | return $clients; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |