| Conditions | 4 |
| Paths | 14 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 8 | public function check(array $config): bool |
|
| 29 | { |
||
| 30 | try { |
||
| 31 | 8 | if (array_get($config, 'default_connection', true)) { |
|
| 32 | 8 | DB::connection()->getPdo(); |
|
| 33 | } |
||
| 34 | |||
| 35 | 8 | foreach (array_get($config, 'connections', []) as $connection) { |
|
| 36 | 4 | DB::connection($connection)->getPdo(); |
|
| 37 | } |
||
| 38 | |||
| 39 | 8 | return true; |
|
| 40 | 8 | } catch (\Exception $e) { |
|
| 41 | 8 | $this->message = $e->getMessage(); |
|
| 42 | } |
||
| 43 | 8 | return false; |
|
| 44 | } |
||
| 45 | |||
| 59 |