Skip to content

Returns $this when injecting Guzzle HTTP Client. Adds doc blocks to v… #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ class Client implements ClientInterface
private $proxyApiUrl;
private $guzzleClient;

/**
* @param GuzzleHttp\ClientInterface $client
* @return $this
*/
public function injectGuzzleHttpClient(GuzzleHttp\ClientInterface $client)
{
$this->guzzleClient = $client;
return $this;
}

/**
Expand Down Expand Up @@ -82,7 +87,6 @@ public function addTopicSubscription($topic_id, $recipients_tokens)
return $this->processTopicSubscription($topic_id, $recipients_tokens, self::DEFAULT_TOPIC_ADD_SUBSCRIPTION_API_URL);
}


/**
* @param integer $topic_id
* @param array|string $recipients_tokens
Expand All @@ -94,7 +98,6 @@ public function removeTopicSubscription($topic_id, $recipients_tokens)
return $this->processTopicSubscription($topic_id, $recipients_tokens, self::DEFAULT_TOPIC_REMOVE_SUBSCRIPTION_API_URL);
}


/**
* @param integer $topic_id
* @param array|string $recipients_tokens
Expand Down Expand Up @@ -122,7 +125,9 @@ protected function processTopicSubscription($topic_id, $recipients_tokens, $url)
);
}


/**
* @return string
*/
private function getApiUrl()
{
return isset($this->proxyApiUrl) ? $this->proxyApiUrl : self::DEFAULT_API_URL;
Expand Down