init(); } public function get(string $key, mixed $default = null): mixed { $config = include $this->getConfigFile(); return $config[$key] ?? $default; } public function set(string $key, mixed $value): void { $config = include $this->getConfigFile(); $config[$key] = $value; $this->writeConfig($config); } private function getConfigFile(): string { return path( $this->getConfigPath(), $this->fileName ); } private function getConfigPath(): string { return $this->path; } private function init(): void { if (file_exists($this->getConfigFile())) { return; } else { if (!is_dir($this->getConfigPath())) { mkdir($this->getConfigPath(), 0755, true); } $this->writeConfig([]); } } public function writeConfig(array $config): void { file_put_contents($this->getConfigFile(), '