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;
        }
    }