public function setTheme(?string $key = null, bool $overrideKey = false) : Theme
    {
        if ($this->useTheme !== null && ($key === null || $this->useTheme === $key)) {
            return $this->useTheme;
        }

        if ($overrideKey) {
            return $this->useTheme = $this->getTheme($key);
        }

        if ($this->themes->hasOverride()) {
            return $this->useTheme = $this->themes->getOverride();
        }

        if ($this->hasUserOverride()) {
            return $this->useTheme = $this->themes->setOverride($this->getUserOverride());
        }

        return $this->useTheme = $this->getTheme($key);
    }
public function setTheme(?string $key = null, bool $overrideKey = false) : Theme
    {
        if ($this->useTheme !== null && ($key === null || $this->useTheme === $key)) {
            return $this->useTheme;
        }

        if ($overrideKey) {
            return $this->useTheme = $this->getTheme($key);
        }

        if ($this->themes->hasOverride()) {
            return $this->useTheme = $this->themes->getOverride();
        }

        if ($this->hasUserOverride()) {
            return $this->useTheme = $this->themes->setOverride($this->getUserOverride());
        }

        return $this->useTheme = $this->getTheme($key);
    }
public function setTheme ( ? string $ key = null , bool $ overrideKey = false ) : Theme { if ( $ this -> useTheme !== null && ( $ key === null || $ this -> useTheme === $ key ) ) { return $ this -> useTheme ; } if ( $ overrideKey ) { return $ this -> useTheme = $ this -> getTheme ( $ key ) ; } if ( $ this -> themes -> hasOverride ( ) ) { return $ this -> useTheme = $ this -> themes -> getOverride ( ) ; } if ( $ this -> hasUserOverride ( ) ) { return $ this -> useTheme = $ this -> themes -> setOverride ( $ this -> getUserOverride ( ) ) ; } return $ this -> useTheme = $ this -> getTheme ( $ key ) ; }
Set theme to use

@param string|null $key
@param bool        $overrideKey
@return \Laranix\Themer\Theme
Set theme to use