Intercept the methods with Channel

@param Channel|InterceptorChannel $channel An already created Channel or InterceptorChannel object (optional)
@param Interceptor|Interceptor[] $interceptors interceptors to be added

@return InterceptorChannel
170773
public static function intercept($channel, $interceptors)
    {
        if (is_array($interceptors)) {
            for ($i = count($interceptors) - 1; $i >= 0; $i--) {
                $channel = new Internal\InterceptorChannel($channel, $interceptors[$i]);
            }
        } else {
            $channel =  new Internal\InterceptorChannel($channel, $interceptors);
        }
        return $channel;
    }
746478
public function subscribe($channels, $callback)
    {
        // Standalone mode: use infinite loop to subscribe until timeout
        $channelCount = \is_array($channels) ? \count($channels) : 1;
        while ($channelCount--) {
            if (isset($status)) {
                list(, , $status) = $this->readReply();
            } else {
                list(, , $status) = $this->__call('subscribe', [$channels]);
            }
            $this->subscribed = $status > 0;
            if (!$status) {
                throw new RedisException('Invalid subscribe response.');
            }
        }

        while ($this->subscribed) {
            [$type, $channel, $message] = $this->readReply();
            if ($type !== 'message') {
                throw new RedisException('Received non-message reply.');
            }
            $callback($this, $channel, $message);
        }
    }
1224960
public function removeChannel($channel)
    {
        $channel = strtolower($channel);
        if (isset($this->channels)) {
            unset($this->channels[$channel]);
        }
        return $this;
    }
353929
public function getChannel($channel)
    {
        $channelId = Utilities::getEntityId(
            $channel,
            'WindowsAzure\MediaServices\Models\Channel'
        );

        return Channel::createFromOptions($this->_getEntity("Channels('{$channelId}')"));
    }
460468
public static <T, R> Function<T, R> intercept(Function<T, R> innermost, Interceptor<T> interceptor) {
        dbc.precondition(interceptor != null, "cannot create an interceptor chain with a null interceptor");
        return new InterceptorChain<>(innermost, new SingletonIterator<Interceptor<T>>(interceptor));
    }
507954
private synchronized void createChannel(String channel) {
        if (!channelExists(channel)) {
            Queue queue = new Queue(channel, true, false, true);
            admin.declareQueue(queue);
            Binding binding = new Binding(channel, DestinationType.QUEUE, exchange.getName(), channel + ".#", null);
            admin.declareBinding(binding);
        }
    }
125593
public function addChannels($channels)
    {
        foreach ($channels as $k => $v) {
            if (preg_match('/^[0-9]+$/', $k)) {
                $this->addChannel($v);
            } else {
                $this->addChannel($k, $v);
            }
        }
        return $this;
    }
404165
public function addSender($channel, $sender)
    {
        $sender = is_string($sender) ? singleton($sender) : $sender;
        $this->senders[$channel] = $sender;

        return $this;
    }
451496
public function subscribe($channel /*, ... */)
    {
        $this->writeRequest(self::SUBSCRIBE, func_get_args());
        $this->statusFlags |= self::STATUS_SUBSCRIBED;
    }
328862
public function setChannels($channels)
    {
        $this->channels = [];

        foreach ($channels as $channel) {
            $this->addChannel($channel);
        }

        return $this;
    }
680076
public function createLogger($channel)
    {
        if (!$this->app->isInstalled()) {
            return new NullLogger();
        }
        $logger = $this->config->createLogger($channel);
        $event = new Event($logger);
        $this->dispatcher->dispatch('on_logger_create', $event);

        return $logger;
    }
428629
public static function createLogger( $channel, array $handlers = array(), array $processors = array() )
    {
        if ( !$handlers )
        {
            $_handler = new StreamHandler( static::$_defaultLog );
            $_handler->setFormatter( new PaddedLineFormatter( null, null, true, true ) );

            $handlers = array($_handler);
        }

        return new Logger( $channel ?: static::DEFAULT_CHANNEL_NAME, $handlers, $processors );
    }
1055595
function resolve($channel) {
        if($channel instanceof \CharlotteDunois\Yasmin\Interfaces\ChannelInterface) {
            return $channel;
        }
        
        if(\is_int($channel)) {
            $channel = (string) $channel;
        }
        
        if(\is_string($channel) && parent::has($channel)) {
            return parent::get($channel);
        }
        
        throw new \InvalidArgumentException('Unable to resolve unknown channel');
    }
1353319
public function addLogger($channel, LoggerInterface $logger)
    {
        $channel = strtolower($channel);

        $this->loggers[$channel] = $logger;

        return $this;
    }
787182
public function addChannel(ChannelOptions $channel)
    {
        $key = $channel->getKey();
        $this->channels[$key] = $channel;
        return $this;
    }
1063000
public function channel(string $channel): Observable
    {
        // Only join a channel once
        if (isset($this->channels[$channel])) {
            return $this->channels[$channel];
        }

        // Ensure we only get messages for the given channel
        $channelMessages = $this->messages->filter(function (Event $event) use ($channel) {
            return $event->getChannel() !== '' && $event->getChannel() === $channel;
        });

        $subscribe = $this->connected
            ->do(function () use ($channel) {
                // Subscribe to pusher channel after connected
                $this->send(Event::subscribeOn($channel));
            })
            ->flatMapTo(Observable::empty());

        // Observable representing channel events
        $this->channels[$channel] = $channelMessages
            ->merge($subscribe)
            ->filter([Event::class, 'subscriptionSucceeded'])
            ->retryWhen(function (Observable $errors) {
                return $errors->flatMap(function (Throwable $throwable) {
                    return $this->handleLowLevelError($throwable);
                });
            })
            ->finally(function () use ($channel) {
                // Send unsubscribe event
                $this->send(Event::unsubscribeOn($channel));

                // Remove our channel from the channel list so we don't resubscribe in case we reconnect
                unset($this->channels[$channel]);
            })
            ->singleInstance();

        return $this->channels[$channel];
    }
374165
public function interceptProxyPrefix(AnnotationCollection $annotations, InterceptionPrefixInterface $interception)
    {
        return $this->runInterceptors($annotations, $interception, function (
            InterceptorInterface $interceptor,
            CacheAnnotationInterface $annotation,
            InterceptionPrefixInterface $interception
        ) {
            return $interceptor->interceptPrefix($annotation, $interception);
        });
    }