protected static function resolveVariant(Config $params) { if (array_key_exists('theme-variant', $params['html'])) { return; } if (is_dir(realpath($params->getThemesPath() . DIRECTORY_SEPARATOR . $params['html']['theme']))) { return; } $theme = explode('-', $params['html']['theme']); // do we have a variant or only a theme ? if (isset($theme[1])) { $params['html']['theme-variant'] = array_pop($theme); $params['html']['theme'] = implode('-', $theme); } else { $params['html']['theme'] = array_pop($theme); } if (!is_dir(realpath($params->getThemesPath() . DIRECTORY_SEPARATOR . $params['html']['theme']))) { throw new \RuntimeException("Theme '{$params['html']['theme']}' not found"); } }