Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
2 / 4 |
|
33.33% |
1 / 3 |
CRAP | |
0.00% |
0 / 1 |
| ValidationException | |
50.00% |
2 / 4 |
|
33.33% |
1 / 3 |
4.12 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| mensagemAmigavel | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| mensagemLog | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Core\Exceptions; |
| 4 | |
| 5 | use Core\Exceptions\CoreException; |
| 6 | |
| 7 | class ValidationException extends CoreException { |
| 8 | public function __construct(string $message, $valorErrado) { |
| 9 | $this->message = $message; |
| 10 | |
| 11 | parent::__construct($this->message); |
| 12 | } |
| 13 | |
| 14 | public function mensagemAmigavel(): string |
| 15 | { |
| 16 | return $this->message; |
| 17 | } |
| 18 | |
| 19 | public function mensagemLog(): string |
| 20 | { |
| 21 | return "$this->message: '$valorErrado' foi utilizado"; |
| 22 | } |
| 23 | } |