Failed Conditions
Push — feature/streamline-console-com... ( 0c27b2...d385c8 )
by
unknown
09:42
created

ArangoCommands   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A useFallback() 0 3 2
A arangodbIsDefaultConnection() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\Aranguent\Console\Concerns;
6
7
trait ArangoCommands
8
{
9
    protected bool $useArangoDB = false;
10
11
12
    protected function arangodbIsDefaultConnection(): bool
13
    {
14
        $connection = \DB::connection();
15
16
        return $connection->getDriverName() === 'arangodb';
17
    }
18
19
    protected function useFallback(): bool
20
    {
21
        return !$this->arangodbIsDefaultConnection() && !$this->useArangoDB;
22
    }
23
}
24