for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Domain\Eventing;
/**
* @author Sebastiaan Hilbers <[email protected]>
*/
abstract class AbstractEventStream implements \IteratorAggregate, \Countable
{
protected $identity;
protected $events;
public function getIterator()
return new \ArrayIterator($this->events);
}
public function getIdentity()
return $this->identity;
public function count()
return count($this->events);
public function first()
return array_shift(array_values($this->events));
array_values($this->events)
array_shift()
$array
public function last()
return array_pop(array_values($this->events));
array_pop()
public function getEvents()
return $this->events;