Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
66.67% |
2 / 3 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| DomainException | |
66.67% |
2 / 3 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getErrorCode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Exception; |
| 4 | |
| 5 | /** |
| 6 | * @author Wilhelm Zwertvaegher |
| 7 | */ |
| 8 | class DomainException extends \Exception |
| 9 | { |
| 10 | private ErrorCode $errorCode; |
| 11 | |
| 12 | public function __construct(ErrorCode $errorCode, string $message, int $code = 0, ?\Exception $previous = null) |
| 13 | { |
| 14 | parent::__construct($message, $code, $previous); |
| 15 | $this->errorCode = $errorCode; |
| 16 | } |
| 17 | |
| 18 | public function getErrorCode(): ErrorCode |
| 19 | { |
| 20 | return $this->errorCode; |
| 21 | } |
| 22 | } |