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