Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Command
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Celemas\Quma\Commands;
6
7use Celemas\Cli\Command as BaseCommand;
8use Celemas\Quma\Connection;
9use Celemas\Quma\Environment;
10
11abstract class Command extends BaseCommand
12{
13    protected readonly Environment $env;
14
15    /** @param array<non-empty-string, Connection>|Connection $conn */
16    public function __construct(array|Connection $conn, array $options = [])
17    {
18        if (is_array($conn)) {
19            $this->env = new Environment($conn, $options);
20        } else {
21            $this->env = new Environment(['default' => $conn], $options);
22        }
23    }
24}