for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Storeman;
class OperationList implements \Countable, \IteratorAggregate
{
/**
* @var OperationListItem[]
*/
protected $items = [];
* Adds an operation to the end of the list.
*
* @param OperationListItem $item
* @return OperationList
public function add(OperationListItem $item): OperationList
$this->items[] = $item;
return $this;
}
* Appends another operation list to the end of this list.
* @param OperationList $other
public function append(OperationList $other): OperationList
$this->items = array_merge($this->items, $other->items);
* Prepends another operation list to the start of this list.
public function prepend(OperationList $other): OperationList
$this->items = array_merge($other->items, $this->items);
* {@inheritdoc}
public function count()
return count($this->items);
public function getIterator(): \Iterator
return new \ArrayIterator($this->items);