public function enabled($slug, $index)
    {
        $map = $this->map;
        $key = '';
        $index = (int)$index == 0 ? 0 : 1 << ($index - 1);
        foreach (explode(static::DELIMITER, $slug) as $child) {
            $key = empty($key) ? $child : $key.static::DELIMITER.$child;

            $isMissing = !$this->slugExists($key);
            $isDisabled = $isMissing ?: !((int)$map[$key] & $index);

            if ($isMissing || $isDisabled) {
                $this->logger->debug('Swivel - "'.$slug.'" is not enabled for bucket '.$index);

                return false;
            }
        }
        $this->logger->debug('Swivel - "'.$slug.'" is enabled for bucket '.$index);

        return true;
    }
public function enabled($slug, $index)
    {
        $map = $this->map;
        $key = '';
        $index = (int)$index == 0 ? 0 : 1 << ($index - 1);
        foreach (explode(static::DELIMITER, $slug) as $child) {
            $key = empty($key) ? $child : $key.static::DELIMITER.$child;

            $isMissing = !$this->slugExists($key);
            $isDisabled = $isMissing ?: !((int)$map[$key] & $index);

            if ($isMissing || $isDisabled) {
                $this->logger->debug('Swivel - "'.$slug.'" is not enabled for bucket '.$index);

                return false;
            }
        }
        $this->logger->debug('Swivel - "'.$slug.'" is enabled for bucket '.$index);

        return true;
    }
public function enabled ( $ slug , $ index ) { $ map = $ this -> map ; $ key = '' ; $ index = ( int ) $ index == 0 ? 0 : 1 << ( $ index - 1 ) ; foreach ( explode ( static :: DELIMITER , $ slug ) as $ child ) { $ key = empty ( $ key ) ? $ child : $ key . static :: DELIMITER . $ child ; $ isMissing = ! $ this -> slugExists ( $ key ) ; $ isDisabled = $ isMissing ? : ! ( ( int ) $ map [ $ key ] & $ index ) ; if ( $ isMissing || $ isDisabled ) { $ this -> logger -> debug ( 'Swivel - "' . $ slug . '" is not enabled for bucket ' . $ index ) ; return false ; } } $ this -> logger -> debug ( 'Swivel - "' . $ slug . '" is enabled for bucket ' . $ index ) ; return true ; }
Check if a feature slug is enabled for a particular bucket index.

@param string $slug
@param int    $index

@return bool

@see \Zumba\Swivel\MapInterface
Check if a feature slug is enabled for a particular bucket index .