protected function isTokenActive(TokenInterface $token)
    {
        if (!$token->hasRequestPatterns()) {
            return true;
        }
        $requestPatternsByType = [];
        /** @var $requestPattern RequestPatternInterface */
        foreach ($token->getRequestPatterns() as $requestPattern) {
            $patternType = TypeHandling::getTypeForValue($requestPattern);
            if (isset($requestPatternsByType[$patternType]) && $requestPatternsByType[$patternType] === true) {
                continue;
            }
            $requestPatternsByType[$patternType] = $requestPattern->matchRequest($this->request);
        }
        return !in_array(false, $requestPatternsByType, true);
    }
protected function isTokenActive(TokenInterface $token)
    {
        if (!$token->hasRequestPatterns()) {
            return true;
        }
        $requestPatternsByType = [];
        /** @var $requestPattern RequestPatternInterface */
        foreach ($token->getRequestPatterns() as $requestPattern) {
            $patternType = TypeHandling::getTypeForValue($requestPattern);
            if (isset($requestPatternsByType[$patternType]) && $requestPatternsByType[$patternType] === true) {
                continue;
            }
            $requestPatternsByType[$patternType] = $requestPattern->matchRequest($this->request);
        }
        return !in_array(false, $requestPatternsByType, true);
    }
protected function isTokenActive ( TokenInterface $ token ) { if ( ! $ token -> hasRequestPatterns ( ) ) { return true ; } $ requestPatternsByType = [ ] ; /** @var $requestPattern RequestPatternInterface */ foreach ( $ token -> getRequestPatterns ( ) as $ requestPattern ) { $ patternType = TypeHandling :: getTypeForValue ( $ requestPattern ) ; if ( isset ( $ requestPatternsByType [ $ patternType ] ) && $ requestPatternsByType [ $ patternType ] === true ) { continue ; } $ requestPatternsByType [ $ patternType ] = $ requestPattern -> matchRequest ( $ this -> request ) ; } return ! in_array ( false , $ requestPatternsByType , true ) ; }
Evaluates any RequestPatterns of the given token to determine whether it is active for the current request
- If no RequestPattern is configured for this token, it is active
- Otherwise it is active only if at least one configured RequestPattern per type matches the request

@param TokenInterface $token
@return bool true if the given token is active, otherwise false
Evaluates any RequestPatterns of the given token to determine whether it is active for the current request - If no RequestPattern is configured for this token it is active - Otherwise it is active only if at least one configured RequestPattern per type matches the request