| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 13 | final class ValidationIncident |
||
| 14 | { |
||
| 15 | private ValidatorDefinition $validatorDefinition; |
||
| 16 | |||
| 17 | private Severity $severity; |
||
| 18 | |||
| 19 | /** @var string[] */ |
||
| 20 | private array $messages = []; |
||
| 21 | |||
| 22 | public function __construct(ValidatorDefinition $validatorDefinition, Severity $severity) |
||
| 23 | { |
||
| 24 | $this->validatorDefinition = $validatorDefinition; |
||
| 25 | $this->severity = $severity; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function addMessage(string $message): self |
||
| 29 | { |
||
| 30 | $this->messages[] = $message; |
||
| 31 | return $this; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getValidatorDefinition(): ValidatorDefinition |
||
| 35 | { |
||
| 36 | return $this->validatorDefinition; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getSeverity(): Severity |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getMessages(): array |
||
| 47 | } |
||
| 48 | } |
||
| 49 |