match

@param mixed $token
@access public
@return void
324909
public function match($token, $ignoreSpaces = true)
    {
        switch($token) {
        case Tokens::T_WHITESPACE:
            $pos = $this->getPosAfterSpaces($this->pos);

            $spaces = substr($this->value, $this->pos, $pos - $this->pos);

            $this->pos = $pos;
            return $spaces;
        case Tokens::T_IDENTIFIER:
            if($ignoreSpaces) {
                $this->ignoreSpaces();
            }
            //
            if(preg_match('/^[\w\d_]+/i', substr($this->value, $this->pos), $matches))
            {
                $identifier = $matches[0];
                $this->pos += strlen($identifier);
                return $identifier;
            }

            throw new \InvalidArgumentException(sprintf('T_IDENTIFIER is not matched with next token.'));
            break;
        default:
            $literal = $this->literals->getLiteralForToken($token);
            
            if($this->literals->isSpace($literal)) {
                $ignoreSpaces = false;
            }
            if($ignoreSpaces) {
                $this->ignoreSpaces();
            }
            // If next token is match with the literal, forward the point
            if($literal !== substr($this->value, $this->pos, strlen($literal))) {
                throw new \InvalidArgumentException(sprintf('Token "%s" is not match with next token on "%s"', $literal, substr($this->value, $this->pos)));
            }
            // 
            $this->pos += strlen($literal);

            return $literal;
            break;
        }
    }
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,
        ]);
    }
435971
private function parsePHPToken($token)
    {
        list($type, $expr) = $token;

        if ($type == T_INLINE_HTML) {
            $expr = $this->compileStatements($expr);
            $expr = $this->compileComments($expr);
            $expr = $this->compileRawEchos($expr);
            $expr = $this->compileRegularEchos($expr);
        }

        return $expr;
    }
326096
public function verify($token)
    {
        $result = $this->find('token', compact('token'))->firstOrFail();

        $event = $this->dispatchEvent('Muffin/Tokenize.beforeVerify', ['token' => $result]);
        if ($event->isStopped()) {
            return false;
        }

        if (!empty($result['foreign_data'])) {
            $table = $this->foreignTable($result);
            $fields = $result['foreign_data'];
            $conditions = [(string)$table->getPrimaryKey() => $result['foreign_key']];
            $table->updateAll($fields, $conditions);
        }

        $result->set('status', true);
        $this->save($result);

        $this->dispatchEvent('Muffin/Tokenize.afterVerify', ['token' => $result]);

        return $result;
    }
993613
protected function checkToken($token)
    {
        try {
            $response = $this->http->get($this->checkTokenURL(), [
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . $token
                ]
            ]);
            $content = json_decode($response->getBody()->getContents());
            if (isset($content->message)) {
                if ($content->message === 'Token is valid') {
                    return true;
                }
            }
        } catch (\Exception $e) {
            return false;
        }
        return false;
    }
964063
public function loginViaToken($token)
    {
        $user = $this->userDao->getUserByToken($token);
        if ($user) {
            $this->loginWithoutPassword($user->getLogin());
            return true;
        } else {
            return false;
        }
    }
420462
final protected static function RawVerify( string $token ) : bool {
        
        self::InitSession( );
        
        $key = self::GetSessionKey( );
        foreach( $_SESSION[ $key ] as $i => $t ) {
            if( hash_equals( $t[self::key_Token], $token ) ) {
                unset( $_SESSION[ $key ][ $i ] );
                return true;
            }
        }
        
        return false;
        
    }
965703
public function isTokenValid($token) {
        $record = List_Unsubscribe_Token::where('token', $token)->first();

        if (!$record) {
            return false;
        }
        return true;
    }
175361
public function exists($token)
    {
        $reset = PasswordReset::where('token', $token)->first();
        return $reset and ! $reset->isExpired();
    }
906483
protected function checkToken($token)
    {
        if (!$token) {
            return false;
        }

        $file = $this->pathForToken($token);
        $content = null;

        if (file_exists($file)) {
            $content = file_get_contents($file);
            unlink($file);
        }

        return $content === $token;
    }
432495
public static function findByActivationToken($token)
    {
        if (!static::isActivationTokenValid($token)) {
            return null;
        }
        return static::find()->where(['activation_token' => $token, 'status' => self::STATUS_REGISTERED])->limit(1)->one();
    }
872107
public function matches($path)
    {
        if (preg_match($this->expr, $path, $this->matches) &&
            in_array($_SERVER['REQUEST_METHOD'], $this->methods)) {
            return true;
        }

        return false;
    }
1370954
public function validateRequest($token)
    {

        // If no token was sent, don't try to _validate it.
        if (empty($token)) {
            $this->_badToken401();
        }

        $validateResponse = $this->_validate($token);

        // If the result is not an array or doesn't contain a subject, send a 401
        if ((!is_array($validateResponse)) || (!array_key_exists('sub', $validateResponse))) {
            $this->_badToken401();
        }

        if (array_key_exists('sub', $validateResponse)) {
            $this->_tokenData = $validateResponse;
            $this->_setPrincipal();
            $this->_setAttributes();
        }

        return true;
    }
385343
public function check($token)
    {
        if (! Cache::has($this->getCacheKey()))
            return false;

        return Cache::get($this->getCacheKey()) === $token;
    }
185044
public function apply(aCssToken &$token)
		{
		if (in_array($token->Property, $this->include) && preg_match($this->reMatch, $token->Value, $m))
			{
			$token->Value = preg_replace($this->reMatch, $this->reReplace, $token->Value);
			}
		return false;
		}
1308680
public function setToken($token)
    {
        $config = $this->navitia_component->getConfiguration();
        $config['token'] = $token;
        $this->navitia_component->setConfiguration($config);
    }
509303
public function deleteToken($token)
    {
        return $this->queryBuilder->from($this->getTokenTable())
            ->where('token', $token)
            ->delete();
    }