Karlomikus\Theme\ThemeInfo::setPath PHP Method

setPath() public method

public setPath ( string $path )
$path string
    public function setPath($path)
    {
        $this->path = $path;
    }

Usage Example

Beispiel #1
0
 /**
  * Parse theme json file
  *
  * @param array $info
  * @return ThemeInfoInterface
  * @throws ThemeInfoAttributeException
  */
 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;
 }