Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Command | |
100.00% |
3 / 3 |
|
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
3 / 3 |
|
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Celemas\Quma\Commands; |
| 6 | |
| 7 | use Celemas\Cli\Command as BaseCommand; |
| 8 | use Celemas\Quma\Connection; |
| 9 | use Celemas\Quma\Environment; |
| 10 | |
| 11 | abstract 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 | } |