| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ConstraintViolation |
||
| 8 | { |
||
| 9 | /** @var string */ |
||
| 10 | protected $title; |
||
| 11 | |||
| 12 | /** @var Dependency[] */ |
||
| 13 | protected $violators = []; |
||
| 14 | |||
| 15 | 7 | public function __construct(string $title) |
|
| 16 | { |
||
| 17 | 7 | $this->title = $title; |
|
| 18 | } |
||
| 19 | |||
| 20 | 3 | public function add(Dependency $violator): void |
|
| 21 | { |
||
| 22 | 3 | $this->violators[] = $violator; |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | public function getTitle(): string |
|
| 26 | { |
||
| 27 | 1 | return $this->title; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return Dependency[] |
||
| 32 | */ |
||
| 33 | 1 | public function getViolators(): array |
|
| 34 | { |
||
| 35 | 1 | return $this->violators; |
|
| 36 | } |
||
| 37 | |||
| 38 | 6 | public function hasViolators(): bool |
|
| 41 | } |
||
| 42 | } |
||
| 43 |