src/Theme.php
public function setTheme(string $theme)
    {
        if (!$this->isPathValid($theme)) {
            throw new NotFoundException('The theme cannot be found.');
        }

        $this->validateTheme($theme);

        $themeInfo = $this->getThemeInfo($theme);

        if (array_key_exists('parent', $themeInfo)) {
            $this->childTheme = $themeInfo;

            $this->setTheme($themeInfo['parent']);
        } else {
            $this->theme = $themeInfo;
        }
    }
public function setTheme(string $theme)
    {
        if (!$this->isPathValid($theme)) {
            throw new NotFoundException('The theme cannot be found.');
        }

        $this->validateTheme($theme);

        $themeInfo = $this->getThemeInfo($theme);

        if (array_key_exists('parent', $themeInfo)) {
            $this->childTheme = $themeInfo;

            $this->setTheme($themeInfo['parent']);
        } else {
            $this->theme = $themeInfo;
        }
    }
public function setTheme ( string $ theme ) { if ( ! $ this -> isPathValid ( $ theme ) ) { throw new NotFoundException ( 'The theme cannot be found.' ) ; } $ this -> validateTheme ( $ theme ) ; $ themeInfo = $ this -> getThemeInfo ( $ theme ) ; if ( array_key_exists ( 'parent' , $ themeInfo ) ) { $ this -> childTheme = $ themeInfo ; $ this -> setTheme ( $ themeInfo [ 'parent' ] ) ; } else { $ this -> theme = $ themeInfo ; } }
Sets a theme

@param string $theme The name of the theme to set

@throws \CodeCollab\Theme\NotFoundException When the theme cannot be found
@throws \CodeCollab\Theme\InvalidException  When the theme is not valid
Sets a theme