for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Cocur\Chain;
use ArrayAccess;
use ArrayIterator;
use IteratorAggregate;
use JsonSerializable;
/**
* Chain.
*
* @author Florian Eckerstorfer
* @copyright 2015-2018 Florian Eckerstorfer
*/
abstract class AbstractChain implements ArrayAccess, IteratorAggregate, JsonSerializable
{
* @var array
public $array = [];
* @return ArrayIterator
public function getIterator(): ArrayIterator
return new ArrayIterator($this->array);
}
* @param mixed $offset
* @return bool
public function offsetExists($offset): bool
return isset($this->array[$offset]);
* @return mixed
public function offsetGet($offset)
return $this->array[$offset];
* @param mixed $value
public function offsetSet($offset, $value): void
$this->array[$offset] = $value;
public function offsetUnset($offset): void
unset($this->array[$offset]);
* @return array
public function jsonSerialize(): array
return $this->array;