DmitryDulepov\Realurl\Decoder\UrlDecoder::decodePreVars PHP Method

decodePreVars() protected method

Decodes preVars into request variables.
protected decodePreVars ( array &$pathSegments ) : array
$pathSegments array
return array
    protected function decodePreVars(array &$pathSegments)
    {
        $requestVariables = array();
        if (count($pathSegments) > 0) {
            $preVarsList = array_filter((array) $this->configuration->get('preVars'));
            $previousValue = '';
            foreach ($preVarsList as $preVarConfiguration) {
                $this->decodeSingleVariable($preVarConfiguration, $pathSegments, $requestVariables, $previousValue);
                if (count($pathSegments) == 0) {
                    break;
                }
            }
            if (isset($requestVariables['L'])) {
                $this->detectedLanguageId = (int) $requestVariables['L'];
            }
        }
        if (is_null($this->detectedLanguageId)) {
            $this->detectedLanguageId = (int) $this->configuration->get('init/defaultLanguageUid');
        }
        return $requestVariables;
    }