. */ namespace SP\Core; use ArrayObject; /** * Class DataCollection * * @template TKey * @template TValue * @template-extends ArrayObject */ abstract class DataCollection extends ArrayObject { public function get(string $key, mixed $default = null): mixed { if ($this->offsetExists($key)) { return $this->offsetGet($key); } return $default; } public function set(string $key, mixed $value): void { $this->offsetSet($key, $value); } public function exists(string $key): bool { return $this->offsetExists($key); } }