src/Activator/CookieActivator.php
public function isActive($name, Context $context)
    {
        // Disable features which aren't whitelisted
        if ($this->mode === self::WHITELIST && !in_array($name, $this->features, true)) {
            return false;
        }

        // Disable features which are blacklisted
        if ($this->mode === self::BLACKLIST && in_array($name, $this->features, true)) {
            return false;
        }

        // Disable if non cookie exists
        if (!array_key_exists($this->name, $_COOKIE)) {
            return false;
        }

        // Enable, if feature is set in cookie
        return in_array($name, array_map('trim', explode($this->separator, $_COOKIE[$this->name])), true);
    }
public function isActive($name, Context $context)
    {
        // Disable features which aren't whitelisted
        if ($this->mode === self::WHITELIST && !in_array($name, $this->features, true)) {
            return false;
        }

        // Disable features which are blacklisted
        if ($this->mode === self::BLACKLIST && in_array($name, $this->features, true)) {
            return false;
        }

        // Disable if non cookie exists
        if (!array_key_exists($this->name, $_COOKIE)) {
            return false;
        }

        // Enable, if feature is set in cookie
        return in_array($name, array_map('trim', explode($this->separator, $_COOKIE[$this->name])), true);
    }
public function isActive ( $ name , Context $ context ) { // Disable features which aren't whitelisted if ( $ this -> mode === self :: WHITELIST && ! in_array ( $ name , $ this -> features , true ) ) { return false ; } // Disable features which are blacklisted if ( $ this -> mode === self :: BLACKLIST && in_array ( $ name , $ this -> features , true ) ) { return false ; } // Disable if non cookie exists if ( ! array_key_exists ( $ this -> name , $ _COOKIE ) ) { return false ; } // Enable, if feature is set in cookie return in_array ( $ name , array_map ( 'trim' , explode ( $ this -> separator , $ _COOKIE [ $ this -> name ] ) ) , true ) ; }
{@inheritdoc}
{