| 1 | <?php |
||
| 7 | class OperationList implements \Countable, \IteratorAggregate |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var OperationInterface[] |
||
| 11 | */ |
||
| 12 | protected $operations = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Adds an operation to the end of the list. |
||
| 16 | * |
||
| 17 | * @param OperationInterface $operation |
||
| 18 | * @return OperationList |
||
| 19 | */ |
||
| 20 | public function addOperation(OperationInterface $operation): OperationList |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Appends another operation list to the end of this list. |
||
| 29 | * |
||
| 30 | * @param OperationList $other |
||
| 31 | * @return OperationList |
||
| 32 | */ |
||
| 33 | public function append(OperationList $other): OperationList |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Prepends another operation list to the start of this list. |
||
| 42 | * |
||
| 43 | * @param OperationList $other |
||
| 44 | * @return OperationList |
||
| 45 | */ |
||
| 46 | public function prepend(OperationList $other): OperationList |
||
| 52 | |||
| 53 | /** |
||
| 54 | * {@inheritdoc} |
||
| 55 | */ |
||
| 56 | public function count() |
||
| 60 | |||
| 61 | /** |
||
| 62 | * {@inheritdoc} |
||
| 63 | */ |
||
| 64 | public function getIterator(): \Iterator |
||
| 68 | } |
||
| 69 |