Karlomikus\Theme\ThemeInfo::setDescription PHP Метод

setDescription() публичный Метод

public setDescription ( null | string $description = null )
$description null | string
    public function setDescription($description = null)
    {
        $this->description = $description;
        if (!isset($description)) {
            $this->description = 'n/a';
        }
    }

Usage Example

Пример #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;
 }