for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright 2018 Vladimir Jimenez
* @license https://github.com/allejo/stakx/blob/master/LICENSE.md MIT
*/
namespace allejo\stakx\Utilities;
class NullableArray implements \ArrayAccess
{
private $data;
public function __construct(array $arr = [])
$this->data = $arr;
}
* {@inheritdoc}
public function offsetExists($offset)
return true;
public function offsetGet($offset)
if (isset($this->data[$offset]))
return $this->data[$offset];
return null;
public function offsetSet($offset, $value)
if ($offset === null) {
return;
$this->data[$offset] = $value;
public function offsetUnset($offset)
unset($this->data[$offset]);