for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Defr\Ares;
use ArrayIterator;
/**
* Class AresRecords.
*
* @author Dennis Fridrich <[email protected]>
*/
final class AresRecords implements \ArrayAccess, \IteratorAggregate, \Countable
{
* @var AresRecord[]
private $array = [];
* @param mixed $offset
* @return bool
public function offsetExists($offset)
if (isset($this->array[$offset])) {
return true;
} else {
return false;
}
* @return bool|AresRecord
public function offsetGet($offset)
if ($this->offsetExists($offset)) {
return $this->array[$offset];
* @param AresRecord $value
public function offsetSet($offset, $value)
if ($offset) {
$this->array[$offset] = $value;
$this->array[] = $value;
public function offsetUnset($offset)
unset($this->array[$offset]);
* @return ArrayIterator
public function getIterator()
return new ArrayIterator($this->array);
* {@inheritdoc}
public function count()
return count($this->array);