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}

Branches

Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once. Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

Command->__construct
16    public function __construct(array|Connection $conn, array $options = [])
17    {
18        if (is_array($conn)) {
18        if (is_array($conn)) {
19            $this->env = new Environment($conn, $options);
21            $this->env = new Environment(['default' => $conn], $options);
22        }
23    }
23    }