protected function getFromQuery(ServerRequestInterface $request)
    {
        $params = array_intersect_key($request->getQueryParams(), array_flip($this->getQueryKeys()));
        $regex  = '~^\/?' . $this->getRegEx() . '\b~';

        foreach ($params as $key => $value) {
            if ( preg_match($regex, $value, $matches) ) {
                if (isset($matches['language'])) {
                    return $matches['language'];
                } else {
                    throw new RuntimeException('The regular expression pattern is missing a named subpattern "language".');
                }
            }
        }
    }
protected function getFromQuery(ServerRequestInterface $request)
    {
        $params = array_intersect_key($request->getQueryParams(), array_flip($this->getQueryKeys()));
        $regex  = '~^\/?' . $this->getRegEx() . '\b~';

        foreach ($params as $key => $value) {
            if ( preg_match($regex, $value, $matches) ) {
                if (isset($matches['language'])) {
                    return $matches['language'];
                } else {
                    throw new RuntimeException('The regular expression pattern is missing a named subpattern "language".');
                }
            }
        }
    }
protected function getFromQuery ( ServerRequestInterface $ request ) { $ params = array_intersect_key ( $ request -> getQueryParams ( ) , array_flip ( $ this -> getQueryKeys ( ) ) ) ; $ regex = '~^\/?' . $ this -> getRegEx ( ) . '\b~' ; foreach ( $ params as $ key => $ value ) { if ( preg_match ( $ regex , $ value , $ matches ) ) { if ( isset ( $ matches [ 'language' ] ) ) { return $ matches [ 'language' ] ; } else { throw new RuntimeException ( 'The regular expression pattern is missing a named subpattern "language".' ) ; } } } }
Retrieve the language from the requested URI's query string.

@param  RequestInterface  $request  PSR7 request object

@return null|string
Retrieve the language from the requested URI s query string .