@param ChannelInterface $channel

@return string
502946
public function getTheme(ChannelInterface $channel)
    {
        if ($configs = $this->resolver->getConfigs($channel)) {
            foreach ($configs as $config) {
                if ($config->getAdapter() === 'website') {
                    $theme = $config->getOptions()->get('theme');

                    if ($this->themeManager->hasTheme($theme)) {
                        return $theme;
                    }
                }
            }
        }

        return 'default';
    }
546344
public function getSender($channel)
    {
        return isset($this->senders[$channel]) ? $this->senders[$channel] : null;
    }
275737
public function send($text, ChannelInterface $channel)
    {
        $message = $this->getMessageBuilder()
                        ->setText($text)
                        ->setChannel($channel)
                        ->create();

        return $this->postMessage($message);
    }
321649
public function sendUpdateChannelOperation(Channel $channel)
    {
        $channelId = $channel->getId();
        Validate::notNull($channelId, 'channelId');

        return $this->_sendOperation(
            $channel,
            "Channels('{$channelId}')",
            Resources::HTTP_MERGE,
            [Resources::STATUS_ACCEPTED, Resources::STATUS_NO_CONTENT]);
    }
111699
public function addChannel($channel)
    {
        if ($channel instanceof ChannelInterface) {
            $channel = $channel->getId();
        }

        $channel = (string) $channel;

        if (false === array_search($channel, $this->channels)) {
            $this->channels[] = $channel;
        }

        return $this;
    }
574024
public function hasChannel($channel)
    {
        if ($channel instanceof ChannelInterface) {
            $channel = $channel->getId();
        }

        $channel = (string) $channel;

        return false === array_search($channel, $this->channels) ? false : true;
    }
866787
private function _UnaryStreamCallFactory($channel)
    {
        if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
            return function ($method,
                             $argument,
                             $deserialize,
                             array $metadata = [],
                             array $options = []) use ($channel) {
                return $channel->getInterceptor()->interceptUnaryStream(
                    $method,
                    $argument,
                    $deserialize,
                    $metadata,
                    $options,
                    $this->_UnaryStreamCallFactory($channel->getNext())
                );
            };
        }
        return $this->_GrpcUnaryStream($channel);
    }
378359
public function findOneByChannel(ChannelInterface $channel): ?CompanyDataInterface
    {
        $qb = $this->createQueryBuilder('cd')
            ->join('cd.channels', 'channels')
            ->where('channels.id IN (:channels)')
            ->setParameter('channels', [$channel->getId()])
            ->setMaxResults(1)
        ;
        
        try {
            return $qb->getQuery()->getOneOrNullResult();
        } catch (NonUniqueResultException $exception) {
            return null;
        }
    }
840054
public static function serialize(RequestInterface $request): string
    {
        return self::requestLine($request).self::headers($request).$request->getBody();
    }
1290985
private function _StreamStreamCallFactory($channel)
    {
        if (is_a($channel, 'Grpc\Internal\InterceptorChannel')) {
            return function ($method,
                             $deserialize,
                             array $metadata = [],
                             array $options = []) use ($channel) {
                return $channel->getInterceptor()->interceptStreamStream(
                    $method,
                    $deserialize,
                    $metadata,
                    $options,
                    $this->_StreamStreamCallFactory($channel->getNext())
                );
            };
        }
        return $this->_GrpcStreamStream($channel);
    }
1040605
public static function responseToString(ResponseInterface $response): string
    {
        $reasonPhrase = $response->getReasonPhrase();
        $headers = self::serializeHeaders($response->getHeaders());
        $body = (string) $response->getBody();
        $format = 'HTTP/%s %d%s%s%s';
        if (! empty($headers)) {
            $headers = self::EOL . $headers;
        }
        $headers .= self::EOL . self::EOL;

        return sprintf(
            $format,
            $response->getProtocolVersion(),
            $response->getStatusCode(),
            ($reasonPhrase ? ' ' . $reasonPhrase : ''),
            $headers,
            $body
        );
    }
209966
public function deleteSubscriber(string $channel): ?Subscriber
    {
        $key = self::SUBSCRIBER_KEY.".{$channel}";
        $hasSubscriber = $this->cache->has($key);

        $subscriber = $this->cache->get($key);

        if ($hasSubscriber) {
            $this->cache->forget($key);
        }

        return $subscriber;
    }
388959
public function subscribe(ChannelInterface $channel, SubscriberInterface $subscriber)
    {
        $this->subscribers[$channel->getIdentifier()][$subscriber->getIdentifier()] = $subscriber;

        return $this;
    }
841400
public function createChannel(Channel $channel)
    {
        $op = $this->sendCreateChannelOperation($channel);

        // waiting for create operation finishes
        $op = $this->awaitOperation($op);

        if ($op->getState() != OperationState::Succeeded) {
            return null;
        }

        // get and return the createChannel
        return $this->getChannel($op->getTargetEntityId());
    }
581156
protected function formatChannels(array $channels)
    {
        return array_map(function ($channel)
        {
            if ($channel instanceof Channel) {
                return $channel->getName();
            }

            return $channel;

        }, $channels);
    }
1025878
public function removeChannel($channel)
    {
        if ($channel instanceof ChannelInterface) {
            $channel = $channel->getId();
        }

        $channel = (string) $channel;

        if (false !== ($key = array_search($channel, $this->channels))) {
            unset($this->channels[$key]);
        }

        return $this;
    }
1374055
public function addChannel(ChannelInterface $channel): bool
    {
        if (!$this->getChannels()->contains($channel)) {
            $this->channels->add($channel);
        }
        
        return true;
    }