| 1 | <?php | ||
| 8 |   abstract class TypedCollection extends BaseCollection { | ||
| 9 | |||
| 10 | |||
| 11 | /** | ||
| 12 | * You can add or append only one type of items to this collection | ||
| 13 | * | ||
| 14 | * @param $item | ||
| 15 | * @throws \Exception | ||
| 16 | */ | ||
| 17 | public abstract function validateType($item); | ||
| 18 | |||
| 19 | |||
| 20 | /** | ||
| 21 | * @inheritdoc | ||
| 22 | */ | ||
| 23 |     public function prepend($item) { | ||
| 27 | |||
| 28 | /** | ||
| 29 | * @inheritdoc | ||
| 30 | */ | ||
| 31 |     public function append($item) { | ||
| 35 | |||
| 36 | /** | ||
| 37 | * @inheritdoc | ||
| 38 | */ | ||
| 39 |     public function addAfter($index, $items) { | ||
| 51 | |||
| 52 | /** | ||
| 53 | * @inheritdoc | ||
| 54 | */ | ||
| 55 |     public function setItems($items) { | ||
| 66 | |||
| 67 | /** | ||
| 68 | * @inheritdoc | ||
| 69 | */ | ||
| 70 |     public function offsetSet($offset, $item) { | ||
| 74 | |||
| 75 | } |