Karlomikus\Theme\Theme::parseThemeInfo PHP Метод

parseThemeInfo() приватный Метод

Parse theme json file
private parseThemeInfo ( array $info ) : ThemeInfoInterface
$info array
Результат ThemeInfoInterface
    private function parseThemeInfo(array $info)
    {
        $themeInfo = new ThemeInfo();
        $required = ['name', 'author', 'namespace'];
        foreach ($required as $key) {
            if (!array_key_exists($key, $info)) {
                throw new ThemeInfoAttributeException($key);
            }
        }
        $themeInfo->setName($info['name']);
        $themeInfo->setAuthor($info['author']);
        $themeInfo->setNamespace(strtolower($info['namespace']));
        if (isset($info['description'])) {
            $themeInfo->setDescription($info['description']);
        }
        if (isset($info['version'])) {
            $themeInfo->setVersion($info['version']);
        }
        if (isset($info['parent'])) {
            $themeInfo->setParent($info['parent']);
        }
        $themeInfo->setPath($this->findPath($info['namespace']));
        return $themeInfo;
    }