DmitryDulepov\Realurl\Encoder\UrlEncoder::handleFileNameSetDefaultSuffix PHP Method

handleFileNameSetDefaultSuffix() protected method

Sets the default suffix to the URL if configured so.
protected handleFileNameSetDefaultSuffix ( ) : void
return void
    protected function handleFileNameSetDefaultSuffix()
    {
        if ($this->encodedUrl) {
            $suffixValue = $this->configuration->get('fileName/defaultToHTMLsuffixOnPrev');
            if ($suffixValue) {
                if (!is_string($suffixValue) || strpos($suffixValue, '.') === FALSE) {
                    $suffixValue = '.html';
                }
                if ($this->encodedUrl !== '') {
                    $this->encodedUrl = rtrim($this->encodedUrl, '/');
                }
                $this->encodedUrl .= $suffixValue;
            }
        }
    }