coniadev /
quma
| 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
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 |