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