| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class AddressValidation implements AddressValidationInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var ValidationInterface[] |
||
| 11 | */ |
||
| 12 | private $validations = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param ValidationInterface[] $validations |
||
| 16 | */ |
||
| 17 | public function __construct(array $validations = []) |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @inheritDoc |
||
| 31 | */ |
||
| 32 | public function validate(AddressInterface $address): void |
||
| 33 | { |
||
| 34 | foreach ($this->getValidations() as $validation) { |
||
| 35 | $validation->execute($address); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @inheritDoc |
||
| 41 | */ |
||
| 42 | public function getValidations(): array |
||
| 45 | } |
||
| 46 | } |
||
| 47 |