Google\Cloud\PubSub\Subscription::info PHP 메소드

info() 공개 메소드

If the info is already cached on the object, it will return that result. To fetch a fresh result, use {@see \Google\Cloud\PubSub\Subscription::reload()}. Example: $info = $subscription->info(); echo $info['name']; // projects/my-awesome-project/subscriptions/my-new-subscription
또한 보기: https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/get Get Subscription
public info ( array $options = [] ) : array
$options array [optional] Configuration Options
리턴 array Subscription data
    public function info(array $options = [])
    {
        if (!$this->info) {
            $this->reload($options);
        }
        return $this->info;
    }

Usage Example

 public function testInfoNoRequest()
 {
     $sub = ['subscription' => 'projects/project-id/subscriptions/subscription-name', 'topic' => 'projects/project-id/topics/topic-name'];
     $this->connection->getSubscription()->shouldNotBeCalled();
     $subscription = new Subscription($this->connection->reveal(), 'project-id', 'subscription-name', 'topic-name', true, $sub);
     $res = $subscription->info();
     $this->assertEquals($res, $sub);
 }