| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | final class OrderException extends \InvalidArgumentException implements \IteratorAggregate, DispatchingException |
||
| 20 | { |
||
| 21 | /** @var Error[] */ |
||
| 22 | private $errors; |
||
| 23 | |||
| 24 | public function __construct(array $errors) |
||
| 25 | { |
||
| 26 | parent::__construct('Не удалось создать заказ.'); |
||
| 27 | |||
| 28 | foreach ($errors as $error) { |
||
| 29 | $this->errors[] = new Error($error['code'], $error['description'] ?? null); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return Error[] |
||
| 35 | */ |
||
| 36 | public function getErrors() |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getIterator(): \Traversable |
||
| 44 | } |
||
| 45 | } |
||
| 46 |