Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| ValidationError | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| result | |
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\Exception; |
| 6 | |
| 7 | use Celemas\Sire\Result; |
| 8 | use RuntimeException; |
| 9 | use Throwable; |
| 10 | |
| 11 | /** @api */ |
| 12 | final class ValidationError extends RuntimeException |
| 13 | { |
| 14 | public function __construct( |
| 15 | private readonly Result $result, |
| 16 | string $message = 'Validation failed', |
| 17 | int $code = 0, |
| 18 | ?Throwable $previous = null, |
| 19 | ) { |
| 20 | parent::__construct($message, $code, $previous); |
| 21 | } |
| 22 | |
| 23 | public function result(): Result |
| 24 | { |
| 25 | return $this->result; |
| 26 | } |
| 27 | } |
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.
| 15 | private readonly Result $result, |
| 16 | string $message = 'Validation failed', |
| 17 | int $code = 0, |
| 18 | ?Throwable $previous = null, |
| 19 | ) { |
| 20 | parent::__construct($message, $code, $previous); |
| 21 | } |
| 25 | return $this->result; |
| 26 | } |