| Total Complexity | 6 | 
| Total Lines | 47 | 
| Duplicated Lines | 0 % | 
| Coverage | 100% | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 7 | final class ValidationContext  | 
            ||
| 8 | { | 
            ||
| 9 | private ?DataSetInterface $dataSet;  | 
            ||
| 10 | private ?string $attribute = null;  | 
            ||
| 11 | private bool $previousRulesErrored = false;  | 
            ||
| 12 | |||
| 13 | 17 | public function __construct(  | 
            |
| 14 | ?DataSetInterface $dataSet = null,  | 
            ||
| 15 | ?string $attribute = null  | 
            ||
| 16 |     ) { | 
            ||
| 17 | 17 | $this->dataSet = $dataSet;  | 
            |
| 18 | 17 | $this->attribute = $attribute;  | 
            |
| 19 | 17 | }  | 
            |
| 20 | |||
| 21 | /**  | 
            ||
| 22 | * @return DataSetInterface|null optional data set  | 
            ||
| 23 | */  | 
            ||
| 24 | 4 | public function getDataSet(): ?DataSetInterface  | 
            |
| 25 |     { | 
            ||
| 26 | 4 | return $this->dataSet;  | 
            |
| 27 | }  | 
            ||
| 28 | |||
| 29 | 4 | public function getAttribute(): ?string  | 
            |
| 30 |     { | 
            ||
| 31 | 4 | return $this->attribute;  | 
            |
| 32 | }  | 
            ||
| 33 | |||
| 34 | 4 | public function withAttribute(?string $attribute): self  | 
            |
| 39 | }  | 
            ||
| 40 | |||
| 41 | /**  | 
            ||
| 42 | * @return bool set to true if rule is part of a group of rules and one of the previous validations failed  | 
            ||
| 43 | */  | 
            ||
| 44 | 17 | public function isPreviousRulesErrored(): bool  | 
            |
| 45 |     { | 
            ||
| 46 | 17 | return $this->previousRulesErrored;  | 
            |
| 47 | }  | 
            ||
| 48 | |||
| 49 | 15 | public function withPreviousRulesErrored(bool $previousRulesErrored): self  | 
            |
| 54 | }  | 
            ||
| 55 | }  | 
            ||
| 56 |