Command   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Conia\Quma\Commands;
6
7
use Conia\Cli\Command as BaseCommand;
8
use Conia\Quma\Connection;
9
use Conia\Quma\Environment;
10
11
abstract class Command extends BaseCommand
12
{
13
    protected readonly Environment $env;
14
15
    /** @psalm-param array<non-empty-string, Connection>|Connection $conn */
16 39
    public function __construct(array|Connection $conn, array $options = [])
17
    {
18 39
        if (is_array($conn)) {
0 ignored issues
show
introduced by
The condition is_array($conn) is always true.
Loading history...
19 5
            $this->env = new Environment($conn, $options);
20
        } else {
21 34
            $this->env = new Environment(['default' => $conn], $options);
22
        }
23
    }
24
}
25