| @@ 15-37 (lines=23) @@ | ||
| 12 | use Del\Form\Filter\FilterInterface; |
|
| 13 | use InvalidArgumentException; |
|
| 14 | ||
| 15 | class FilterCollection extends AbstractCollection implements CollectionInterface |
|
| 16 | { |
|
| 17 | /** |
|
| 18 | * @param FilterInterface $filter |
|
| 19 | * @return $this |
|
| 20 | */ |
|
| 21 | public function append($filter) |
|
| 22 | { |
|
| 23 | if(!$filter instanceof FilterInterface) { |
|
| 24 | throw new InvalidArgumentException('You can only append a Del\Form\Filter\FilterInterface.'); |
|
| 25 | } |
|
| 26 | parent::append($filter); |
|
| 27 | return $this; |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @return FilterInterface |
|
| 32 | */ |
|
| 33 | public function current() |
|
| 34 | { |
|
| 35 | return parent::current(); |
|
| 36 | } |
|
| 37 | } |
|
| @@ 15-37 (lines=23) @@ | ||
| 12 | use Del\Form\Validator\ValidatorInterface; |
|
| 13 | use InvalidArgumentException; |
|
| 14 | ||
| 15 | class ValidatorCollection extends AbstractCollection implements CollectionInterface |
|
| 16 | { |
|
| 17 | /** |
|
| 18 | * @param ValidatorInterface $validator |
|
| 19 | * @return $this |
|
| 20 | */ |
|
| 21 | public function append($validator) |
|
| 22 | { |
|
| 23 | if(!$validator instanceof ValidatorInterface) { |
|
| 24 | throw new InvalidArgumentException('You can only append a Del\Form\Validator\ValidatorInterface.'); |
|
| 25 | } |
|
| 26 | parent::append($validator); |
|
| 27 | return $this; |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @return ValidatorInterface |
|
| 32 | */ |
|
| 33 | public function current() |
|
| 34 | { |
|
| 35 | return parent::current(); |
|
| 36 | } |
|
| 37 | } |
|