src/Parser/FieldParser.php
private function parseBundle(array $tokenBundle, $serverField, $fromField)
    {
        $pref = null;
        try {
            list($variantTokenList, $paramTokenList) = $this->splitVariantAndParamTokens($tokenBundle, $fromField);

            $paramBundleList = $this->bundleTokens($paramTokenList, Tokens::PARAMS_SEPARATOR);
            $this->validateParamBundleList($paramBundleList, $serverField);

            $pref = $this->createPreference($variantTokenList, $paramBundleList, $serverField, $fromField);

        } catch (InvalidVariantException $e) {
            if ($serverField) {
                throw $e;
            }
        }

        return $pref;
    }
private function parseBundle(array $tokenBundle, $serverField, $fromField)
    {
        $pref = null;
        try {
            list($variantTokenList, $paramTokenList) = $this->splitVariantAndParamTokens($tokenBundle, $fromField);

            $paramBundleList = $this->bundleTokens($paramTokenList, Tokens::PARAMS_SEPARATOR);
            $this->validateParamBundleList($paramBundleList, $serverField);

            $pref = $this->createPreference($variantTokenList, $paramBundleList, $serverField, $fromField);

        } catch (InvalidVariantException $e) {
            if ($serverField) {
                throw $e;
            }
        }

        return $pref;
    }
private function parseBundle ( array $ tokenBundle , $ serverField , $ fromField ) { $ pref = null ; try { list ( $ variantTokenList , $ paramTokenList ) = $ this -> splitVariantAndParamTokens ( $ tokenBundle , $ fromField ) ; $ paramBundleList = $ this -> bundleTokens ( $ paramTokenList , Tokens :: PARAMS_SEPARATOR ) ; $ this -> validateParamBundleList ( $ paramBundleList , $ serverField ) ; $ pref = $ this -> createPreference ( $ variantTokenList , $ paramBundleList , $ serverField , $ fromField ) ; } catch ( InvalidVariantException $ e ) { if ( $ serverField ) { throw $ e ; } } return $ pref ; }
Accepts tokens for a single variant and returns the Preference value object encapsulating that data.

@throws InvalidVariantException

@param array<string> $tokenBundle
@param bool $serverField
@param string $fromField

@return null|PreferenceInterface
Accepts tokens for a single variant and returns the Preference value object encapsulating that data .