src/Event/Subject.php
public function shouldProcess($mode, $actions = [])
    {
        if (is_string($actions)) {
            $actions = [$actions];
        }

        switch ($mode) {
            case 'only':
                return in_array($this->action, $actions);

            case 'not':
                return !in_array($this->action, $actions);

            default:
                throw new \Exception('Invalid mode');
        }
    }
public function shouldProcess($mode, $actions = [])
    {
        if (is_string($actions)) {
            $actions = [$actions];
        }

        switch ($mode) {
            case 'only':
                return in_array($this->action, $actions);

            case 'not':
                return !in_array($this->action, $actions);

            default:
                throw new \Exception('Invalid mode');
        }
    }
public function shouldProcess ( $ mode , $ actions = [ ] ) { if ( is_string ( $ actions ) ) { $ actions = [ $ actions ] ; } switch ( $ mode ) { case 'only' : return in_array ( $ this -> action , $ actions ) ; case 'not' : return ! in_array ( $ this -> action , $ actions ) ; default : throw new \ Exception ( 'Invalid mode' ) ; } }
Check if the called action is white listed or blacklisted
depending on the mode

Modes:
only => only if in array (white list)
not  => only if NOT in array (blacklist)

@param string $mode Mode
@param mixed $actions Actions list
@return bool
@throws \Exception In case of invalid mode
Check if the called action is white listed or blacklisted depending on the mode