src/GoogleCloudPubSubAdapter.php
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;
    }
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;
    }
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 ; }
Return a `Subscription` instance from a channel name.

If the subscription doesn't exist, the subscription is first created.

@param string $channel

@return \Google\Cloud\PubSub\Subscription
Return a Subscription instance from a channel name .