Total Complexity | 8 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 91.67% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait ArangoCommands |
||
8 | { |
||
9 | public bool $useArangoDB = false; |
||
10 | |||
11 | 6 | protected function connectionHasArangodbDriver(?string $name): bool |
|
12 | { |
||
13 | 6 | if ($name == '' && ! $this->arangodbIsDefaultConnection()) { |
|
14 | return false; |
||
15 | } |
||
16 | 6 | if ($name == '' && $this->arangodbIsDefaultConnection()) { |
|
17 | 3 | return true; |
|
18 | } |
||
19 | |||
20 | 3 | $connections = config('database.connections'); |
|
21 | |||
22 | 3 | return $connections[$name]['driver'] === 'arangodb'; |
|
23 | } |
||
24 | |||
25 | 343 | protected function arangodbIsDefaultConnection(): bool |
|
26 | { |
||
27 | 343 | $connection = \DB::connection(); |
|
28 | |||
29 | 343 | return $connection->getDriverName() === 'arangodb'; |
|
30 | } |
||
31 | |||
32 | |||
33 | 39 | protected function useFallback(): bool |
|
36 | } |
||
37 | } |
||
38 |