Apply filters to the token. Can return null when the token was removed.

@param  Zend_Search_Lucene_Analysis_Token $token
@return Zend_Search_Lucene_Analysis_Token
170001
public function normalize(Zend_Search_Lucene_Analysis_Token $token)
    {
        foreach ($this->_filters as $filter) {
            $token = $filter->normalize($token);

            // resulting token can be null if the filter removes it
            if ($token === null) {
                return null;
            }
        }

        return $token;
    }
196943
protected function findUserByToken(Token $token)
    {
        // retrieves the user ID from the token.
        $id = $token->getClaim('sub');

        // use the users provider to find the token subject (user)
        // but it's id (subject)
        return $this->provider->retrieveById($id);
    }
508516
public static function findByPasswordResetToken($token, $status = self::STATUS_ACTIVE)
    {
        if (!static::isPasswordResetTokenValid($token)) {
            return null;
        }
        if ($status == null) {
            return static::find()->where(['password_reset_token' => $token])->limit(1)->one();
        }
        return static::find()->where(['password_reset_token' => $token, 'status' => $status])->limit(1)->one();
    }
225684
public function getByAccessToken(string $token)
	{
		return $this->setAuthorizer($this->getModel()->where('access_token', '=', $token)->first());
	}
737600
public function parse(Token $token)
    {
        $variable = substr($token->getValue(), 1);

        if ('current' === $variable) {
            return new FunctionCallValue(
                'current',
                [new ValueForCurrentValue()]
            );
        }

        try {
            return new VariableValue($variable);
        } catch (TypeError $error) {
            throw ExpressionLanguageExceptionFactory::createForUnparsableToken($token, 0, $error);
        }
    }
850591
public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken) 
    {
        if (strlen($srcToken->getTermText()) < $this->length) {
            return null;
        } else {
            return $srcToken;
        }
    }
1359350
public function update(Token $token)
    {
        $this->om->persist($token);
        $this->om->flush();

        return $token;
    }
1182144
public function getTransactionResult($token = null)
    {
        if (!$token) {
            $token = $_POST['token_ws'];
        }

        return $this->service->getTransactionResult($token)->return;
    }
381240
public function seek($index, $token = false)
    {
        $this->_current = (int) $index;
        return $this->current($token);
    }
1320319
private function resolveToken( $token )
    {
        $replaceString = "";
        $tokenParts = $this->tokenParts( $token );

        foreach ( $tokenParts as $tokenPart )
        {
            if ( $this->isTokenGroup( $tokenPart ) )
            {
                $groupTokenArray = $this->extractTokens( $this->groupLookupTable[$tokenPart] );
                $replaceString = $this->groupLookupTable[$tokenPart];

                foreach ( $groupTokenArray as $groupToken )
                {
                    $replaceString = str_replace( $groupToken, $this->resolveToken( $groupToken ), $replaceString );
                }
                // We want to stop after the first matching token part / identifier is found
                // <id1|id2> if id1 has a value, id2 will not be used.
                // In this case id1 or id1 is a token group.
                break;
            }
            else
            {
                if ( isset( $this->attributeArray[$tokenPart] ) && $this->attributeArray[$tokenPart] !== '' && $this->attributeArray[$tokenPart] !== false )
                {
                    $replaceString = $this->attributeArray[$tokenPart];
                    // We want to stop after the first matching token part / identifier is found
                    // <id1|id2> if id1 has a value, id2 will not be used.
                    break;
                }
            }
        }
        return $replaceString;
    }
538251
public static function findByPasswordResetToken(string $token) : ?self
    {
        if (!static::isPasswordResetTokenValid($token)) {
            return null;
        }
        return static::findOne([
            'password_reset_token' => $token,
            'status' => self::STATUS_ACTIVE,
        ]);
    }
331324
public function removeToken($token)
    {
        if ($token instanceof \Gems_Tracker_Token) {
            $tokenId = $token->getTokenId();
        } else {
            $tokenId = $token;
        }
        unset($this->_tokens[$tokenId]);

        return $this;
    }
255349
public function addToken($token)
    {
        if (!in_array($token, $this->tokens)) {
            $this->tokens[] = $token;
        }

        return $this;
    }
719861
public function findByActivationToken($token)
    {
        $userMeta = $this->userMeta->where('activation_token', $token)->first();

        if ($userMeta) {
            return $userMeta->user()->first();
        }

        return false;
    }
1308114
protected function clearToken($token)
    {
        $token = $this->tokenize($token);
        $this->checkToken($token);
        $this->tokens[$token] = array();
    }
980511
public function getByActionToken(string $token)
	{
		return $this->setAuthorizer($this->getModel()->where('action_token', '=', $token)->first());
	}
280786
public function match($token)
    {
        $lookaheadType = $this->lexer->lookahead['type'];

        // Short-circuit on first condition, usually types match
        if ($lookaheadType === $token) {
            $this->lexer->moveNext();

            return;
        }

        // If parameter is not identifier (1-99) must be exact match
        if ($token < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is keyword (200+) must be exact match
        if ($token > Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is T_IDENTIFIER, then matches T_IDENTIFIER (100) and keywords (200+)
        if ($token === Lexer::T_IDENTIFIER && $lookaheadType < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        $this->lexer->moveNext();
    }