| 1 | <?php |
||
| 17 | class ErrorCollectionIterator implements \IteratorAggregate |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var ErrorCollection |
||
| 21 | */ |
||
| 22 | private $collection; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var callable|RenderError |
||
| 26 | */ |
||
| 27 | private $render_error; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param ErrorCollection $collection |
||
| 31 | * @param RenderError|callable $render_error |
||
| 32 | */ |
||
| 33 | public function __construct(ErrorCollection $collection, callable $render_error = null) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @inheritdoc |
||
| 41 | */ |
||
| 42 | public function getIterator() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Renders an error into a string. |
||
| 54 | * |
||
| 55 | * @param Error $error |
||
| 56 | * @param string $attribute |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | protected function render_error(Error $error, $attribute) |
||
| 66 | } |
||
| 67 |