| 1 | <?php |
||
| 5 | class OperationList implements \Countable, \IteratorAggregate |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var OperationListItem[] |
||
| 9 | */ |
||
| 10 | protected $items = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Adds an operation to the end of the list. |
||
| 14 | * |
||
| 15 | * @param OperationListItem $item |
||
| 16 | * @return OperationList |
||
| 17 | */ |
||
| 18 | public function add(OperationListItem $item): OperationList |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Appends another operation list to the end of this list. |
||
| 27 | * |
||
| 28 | * @param OperationList $other |
||
| 29 | * @return OperationList |
||
| 30 | */ |
||
| 31 | public function append(OperationList $other): OperationList |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Prepends another operation list to the start of this list. |
||
| 40 | * |
||
| 41 | * @param OperationList $other |
||
| 42 | * @return OperationList |
||
| 43 | */ |
||
| 44 | public function prepend(OperationList $other): OperationList |
||
| 50 | |||
| 51 | /** |
||
| 52 | * {@inheritdoc} |
||
| 53 | */ |
||
| 54 | public function count() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * {@inheritdoc} |
||
| 61 | */ |
||
| 62 | public function getIterator(): \Iterator |
||
| 66 | } |
||
| 67 |