. */ declare(strict_types=1); namespace FireflyIII\Support; use ArrayObject; class NullArrayObject extends ArrayObject { public $default = null; /** * NullArrayObject constructor. * * @param array $array * @param null $default */ public function __construct(array $array, $default = null) { parent::__construct($array); $this->default = $default; } /** * @param mixed $key * * @return mixed|null */ public function offsetGet($key) { if ($this->offsetExists($key)) { return parent::offsetGet($key); } return null; } }