@param string $channel

@return Item[]
@throws Exception\LogicException
187080
public function fetch($channel = 'default')
    {
        if (!is_string($channel)) {
            throw new LogicException('You tried to add a invalid channel.');
        }

        $items = $this->retrieve($channel);

        foreach ($this->processors as $processor) {
            $items = $processor->process($items);
        }

        return $items;
    }
194828
public static function getCoreChannels()
    {
        return [
            self::CHANNEL_EMAIL,
            self::CHANNEL_EXCEPTIONS,
            self::CHANNEL_PACKAGES,
            self::CHANNEL_SECURITY,
            self::CHANNEL_AUTHENTICATION,
            self::CHANNEL_PERMISSIONS,
            self::CHANNEL_SPAM,
            self::CHANNEL_SITE_ORGANIZATION,
            self::CHANNEL_NETWORK,
            self::CHANNEL_USERS,
            self::CHANNEL_OPERATIONS,
            self::CHANNEL_API,
        ];
    }
95356
public static function metadata(string $content): array
	{
		if (preg_match_all(self::$metadataPattern, $content, $matches) !== false) {
			$combine = array_combine($matches[1], $matches[2]);

			if ($combine === false) {
				throw new LogicException('Matches count is not equal.');
			}

			return $combine;
		}

		return [];
	}
457641
public function pop($channel = '')
    {
        $channel = $channel ?: static::$defaultChannel;
        return $this->channelOrFail($channel)->pop($channel);
    }
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');
    }
980969
public function channelsVideo($channel, $options = null)
    {
        $availableOptions = ['limit', 'offset', 'broadcasts', 'hls'];

        $query = [];

        //  Filter the available options
        foreach ($availableOptions as $option) {

            if (isset($options[ $option ])) {

                $query[ $option ] = $options[ $option ];
            }
        }

        $parameters = $this->getDefaultHeaders();
        $parameters[ 'query' ] = $query;

        $response = $this->client->get('/kraken/channels/' . $channel . '/videos', $parameters);

        return $response->json();
    }
581156
protected function formatChannels(array $channels)
    {
        return array_map(function ($channel)
        {
            if ($channel instanceof Channel) {
                return $channel->getName();
            }

            return $channel;

        }, $channels);
    }
210240
public function awaitContentHeader($channel)
    {
        if ($this instanceof Async\Client) {
            $deferred = new Deferred();
            $this->addAwaitCallback(function ($frame) use ($deferred, $channel) {
                if ($frame instanceof Protocol\ContentHeaderFrame && $frame->channel === $channel) {
                    $deferred->resolve($frame);
                    return true;
                } elseif ($frame instanceof Protocol\MethodChannelCloseFrame && $frame->channel === $channel) {
                    $this->channelCloseOk($channel)->done(function () use ($frame, $deferred) {
                        $deferred->reject(new ClientException($frame->replyText, $frame->replyCode));
                    });
                    return true;
                } elseif ($frame instanceof Protocol\MethodConnectionCloseFrame) {
                    $this->connectionCloseOk()->done(function () use ($frame, $deferred) {
                        $deferred->reject(new ClientException($frame->replyText, $frame->replyCode));
                    });
                    return true;
                }
                return false;
            });
            return $deferred->promise();
        } else {
            for (;;) {
                while (($frame = $this->getReader()->consumeFrame($this->getReadBuffer())) === null) {
                    $this->feedReadBuffer();
                }
                if ($frame instanceof Protocol\ContentHeaderFrame && $frame->channel === $channel) {
                    return $frame;
                } elseif ($frame instanceof Protocol\MethodChannelCloseFrame && $frame->channel === $channel) {
                    $this->channelCloseOk($channel);
                    throw new ClientException($frame->replyText, $frame->replyCode);
                } elseif ($frame instanceof Protocol\MethodConnectionCloseFrame) {
                    $this->connectionCloseOk();
                    throw new ClientException($frame->replyText, $frame->replyCode);
                } else {
                    $this->enqueue($frame);
                }
            }
        }
        throw new \LogicException('This statement should be never reached.');
    }
37229
public function has_channel( $channel ) {

		if ( ! is_string( $channel ) ) {
			throw InvalidChannelNameException::for_invalid_type( $channel );
		}

		return in_array( $channel, $this->channels );
	}
256193
public function setChannel(array $channel)
    {
        foreach ($channel as $element => $value) {
            $setter = 'set' . ucfirst($element);

            if (method_exists($this, $setter)) {
                $this->$setter($value);
                unset($channel[$element]);
            }
        }

        $this->channel = $channel;

        return $this;
    }
622437
public function getRootLocations($channel)
    {
        $repository = $this->em->getRepository('CampaignChainCoreBundle:Location');

        $query = $repository->createQueryBuilder('l')
            ->where('l.channel = :channel')
            ->andWhere('l.parent IS NULL')
            ->orderBy('l.name', 'ASC')
            ->setParameter('channel', $channel)
            ->getQuery();

        return $query->getResult();
    }
1224960
public function removeChannel($channel)
    {
        $channel = strtolower($channel);
        if (isset($this->channels)) {
            unset($this->channels[$channel]);
        }
        return $this;
    }
561115
public function getFollowers($channel, $params = [])
  {
      $defaults = [
      'limit'     => 25,
      'offset'    => 0,
      'direction' => 'desc',
      'cursor'    => null,
    ];

      return $this->wrapper->request('GET', "channels/$channel/follows", ['query' => $this->resolveOptions($params, $defaults)]);
  }
389466
static function getTypeForChannel(\CharlotteDunois\Yasmin\Interfaces\ChannelInterface $channel) {
        if($channel instanceof \CharlotteDunois\Yasmin\Interfaces\GroupDMChannelInterface) {
            return self::CHANNEL_TYPES['group'];
        } elseif($channel instanceof \CharlotteDunois\Yasmin\Interfaces\DMChannelInterface) {
            return self::CHANNEL_TYPES['dm'];
        } elseif($channel instanceof \CharlotteDunois\Yasmin\Interfaces\GuildVoiceChannelInterface) {
            return self::CHANNEL_TYPES['voice'];
        } elseif($channel instanceof \CharlotteDunois\Yasmin\Interfaces\CategoryChannelInterface) {
            return self::CHANNEL_TYPES['category'];
        } elseif($channel instanceof \CharlotteDunois\Yasmin\Interfaces\GuildNewsChannelInterface) {
            return self::CHANNEL_TYPES['news'];
        } elseif($channel instanceof \CharlotteDunois\Yasmin\Interfaces\GuildStoreChannelInterface) {
            return self::CHANNEL_TYPES['store'];
        }
        
        return self::CHANNEL_TYPES['text'];
    }
1258930
public function getChannelByName($name)
    {
        return $this->getChannels()->then(function (array $channels) use ($name) {
            foreach ($channels as $channel) {
                if ($channel->getName() === $name) {
                    return $channel;
                }
            }

            throw new ApiException('Channel ' . $name . ' not found.');
        });
    }
130359
protected function parseEntry($entry)
    {
        if (!get_property($entry, 'url')) {
            throw new \InvalidArgumentException('Url is missing or not accessible.');
        }
        $url        = get_property($entry, 'url');
        $lastmod    = get_property($entry, 'lastmod');
        $changefreq = get_property($entry, 'changefreq');
        $priority   = get_property($entry, 'priority');

        return [$url, $lastmod, $changefreq, $priority];
    }
324901
protected function getSubscriptionForChannel($channel)
    {
        $topic = $this->getTopicForChannel($channel);
        $clientIdentifier = $this->clientIdentifier ? $this->clientIdentifier : 'default';
        $clientIdentifier .= '.' . $channel;
        $subscription = $topic->subscription($clientIdentifier);
        if ($this->autoCreateSubscriptions && !$subscription->exists()) {
            $subscription->create();
        }
        return $subscription;
    }