namespace[$namespace] = [ 'path' => $filePath, 'data' => $data ]; } function importArray(string $namespace, array $data = []) { if (isset($this->namespace[$namespace])) { $data = array_merge($this->namespace[$namespace]['data'], $data); } $this->namespace[$namespace] = [ 'path' => null, 'data' => $data ]; } public function get(string $ns, string $key) { if (isset($this->namespace[$ns]['data'][$key])) { return $this->namespace[$ns]['data'][$key]; } throw new Exception('Unknown key ' . $ns . '::' . $key); } public function getOpt(string $ns, string $key) { if (isset($this->namespace[$ns]['data'][$key])) { return $this->namespace[$ns]['data'][$key]; } return null; } public function has(string $ns, string $key): bool { return isset($this->namespace[$ns]['data'][$key]); } function set(string $ns, string $key, mixed $value): void { $this->namespace[$ns]['data'][$key] = $value; } }