getExtension() === "json") { $key = $file->getBasename(".json"); $value = @json_decode(@file_get_contents($file->getPathname()), true); if ($value === null) { throw new RuntimeException("Network file " . $file->getBasename() . " is invalid or cannot be read"); } $this->configs[$key] = $value; } } } public function getConfigs(): array { return $this->configs; } }