Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
| Failure | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| key | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| invalid | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| message | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Celemas\Sire; |
| 6 | |
| 7 | /** @api */ |
| 8 | final readonly class Failure |
| 9 | { |
| 10 | /** @param list<mixed> $args */ |
| 11 | public function __construct( |
| 12 | public string $key = '', |
| 13 | public array $args = [], |
| 14 | public ?string $fallback = null, |
| 15 | ) {} |
| 16 | |
| 17 | public static function key(string $key, mixed ...$args): self |
| 18 | { |
| 19 | /** @var list<mixed> $list */ |
| 20 | $list = $args; |
| 21 | |
| 22 | return new self($key, $list); |
| 23 | } |
| 24 | |
| 25 | public static function invalid(?string $fallback = null, mixed ...$args): self |
| 26 | { |
| 27 | /** @var list<mixed> $list */ |
| 28 | $list = $args; |
| 29 | |
| 30 | return new self(args: $list, fallback: $fallback); |
| 31 | } |
| 32 | |
| 33 | public static function message(string $message): self |
| 34 | { |
| 35 | return self::invalid(fallback: $message); |
| 36 | } |
| 37 | } |
Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not
necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once.
Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement
always has an else as part of its logical flow even if you didn't write one.
| 12 | public string $key = '', |
| 13 | public array $args = [], |
| 14 | public ?string $fallback = null, |
| 15 | ) {} |
| 25 | public static function invalid(?string $fallback = null, mixed ...$args): self |
| 26 | { |
| 27 | /** @var list<mixed> $list */ |
| 28 | $list = $args; |
| 29 | |
| 30 | return new self(args: $list, fallback: $fallback); |
| 31 | } |
| 17 | public static function key(string $key, mixed ...$args): self |
| 18 | { |
| 19 | /** @var list<mixed> $list */ |
| 20 | $list = $args; |
| 21 | |
| 22 | return new self($key, $list); |
| 23 | } |
| 33 | public static function message(string $message): self |
| 34 | { |
| 35 | return self::invalid(fallback: $message); |
| 36 | } |