Failed Conditions
Branch feature/streamline-console-com... (d385c8)
by Bas
11:19
created

ArangoCommands::useFallback()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
nc 2
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
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