Google\Cloud\PubSub\PubSubClient::subscription PHP Method

subscription() public method

This method will NOT perform any API calls. If you wish to create a new subscription, use {@see \Google\Cloud\PubSub\PubSubClient::subscribe()}. Unless you are sure the subscription exists, you should check its existence before using it. Example: $subscription = $pubsub->subscription('my-new-subscription');
public subscription ( string $name, string $topicName = null ) : Subscription
$name string The subscription name
$topicName string [optional] The topic name
return Subscription
    public function subscription($name, $topicName = null)
    {
        return $this->subscriptionFactory($name, $topicName);
    }