lib/Languages/Galach/TokenExtractor.php
private function createToken($type, $position, array $data)
    {
        if ($type === Tokenizer::TOKEN_GROUP_BEGIN) {
            return $this->createGroupBeginToken($position, $data);
        }

        if ($type === Tokenizer::TOKEN_TERM) {
            return $this->createTermToken($position, $data);
        }

        return new Token($type, $data['lexeme'], $position);
    }
private function createToken($type, $position, array $data)
    {
        if ($type === Tokenizer::TOKEN_GROUP_BEGIN) {
            return $this->createGroupBeginToken($position, $data);
        }

        if ($type === Tokenizer::TOKEN_TERM) {
            return $this->createTermToken($position, $data);
        }

        return new Token($type, $data['lexeme'], $position);
    }
private function createToken ( $ type , $ position , array $ data ) { if ( $ type === Tokenizer :: TOKEN_GROUP_BEGIN ) { return $ this -> createGroupBeginToken ( $ position , $ data ) ; } if ( $ type === Tokenizer :: TOKEN_TERM ) { return $ this -> createTermToken ( $ position , $ data ) ; } return new Token ( $ type , $ data [ 'lexeme' ] , $ position ) ; }
Create a token object from the given parameters.

@param int $type Token type
@param int $position Position of the token in the input string
@param array $data Regex match data, depends on the type of the token

@return \QueryTranslator\Values\Token
Create a token object from the given parameters .