Conditions | 6 |
Paths | 19 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function check(array $config): bool |
||
29 | { |
||
30 | try { |
||
31 | if (array_get($config, 'default_connection', true)) { |
||
32 | if (!Redis::connection()->isConnected()) { |
||
33 | return false; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | foreach (array_get($config, 'connections', []) as $connection) { |
||
38 | if (!Redis::connection($connection)->isConnected()) { |
||
39 | return false; |
||
40 | } |
||
41 | } |
||
42 | |||
43 | return true; |
||
44 | } catch (\Exception $e) { |
||
45 | $this->message = $e->getMessage(); |
||
46 | } |
||
47 | |||
48 | return false; |
||
49 | } |
||
50 | |||
64 |