Airship\Cabin\Bridge\Blueprint\ChannelUpdates::getChannelURLs PHP Method

getChannelURLs() protected method

Get all URLs
protected getChannelURLs ( boolean $doNotShuffle = false ) : array
$doNotShuffle boolean
return array
    protected function getChannelURLs(bool $doNotShuffle = false) : array
    {
        $state = State::instance();
        $candidates = [];
        if ($state->universal['tor-only']) {
            // Prioritize Tor Hidden Services
            $after = [];
            foreach ($this->urls as $url) {
                if (\Airship\isOnionUrl($url)) {
                    $candidates[] = $url;
                } else {
                    $after[] = $url;
                }
            }
            // Shuffle each array separately, to maintain priority;
            if (!$doNotShuffle) {
                \Airship\secure_shuffle($candidates);
                \Airship\secure_shuffle($after);
            }
            foreach ($after as $url) {
                $candidates[] = $url;
            }
        } else {
            $candidates = $this->urls;
            if (!$doNotShuffle) {
                \Airship\secure_shuffle($candidates);
            }
        }
        return $candidates;
    }