public function __construct($themeDir, $outputDir, $themeConfig, $config, Documentation $documentation) { $this->outputDir = $outputDir; $this->themeConfig = $themeConfig; $this->themeDir = $themeDir; $this->options = $themeConfig["options"]; $this->projectConfig = $config; $this->documentation = $documentation; $themeInfosPath = $this->getThemePath("theme.json"); if ($themeInfosPath) { $themeInfos = json_decode(file_get_contents($themeInfosPath), true); if (!$themeInfos) { throw new Exception("Cant parse file {$themeInfosPath}"); } else { $this->themeInfos = $themeInfos; if (isset($themeInfos["extends"])) { $extThemePath = $documentation->findThemePathByName($themeInfos["extends"]); if (!$extThemePath) { throw new Exception("Unable to find extended theme " . $themeInfos["extends"]); } $this->extendedTheme = new Theme($extThemePath, $outputDir, $themeConfig, $config, $documentation); } } } }