From 2f21349c4613c10cdb7b1e89d0ad9205488c8d00 Mon Sep 17 00:00:00 2001 From: Luke Kuzmish Date: Wed, 5 Apr 2023 13:36:00 -0400 Subject: [PATCH 1/2] make IntercomClient methods protected --- src/IntercomClient.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/IntercomClient.php b/src/IntercomClient.php index 076f9ed5..d6ce39f5 100644 --- a/src/IntercomClient.php +++ b/src/IntercomClient.php @@ -312,7 +312,7 @@ public function getRateLimitDetails() /** * @return HttpClient */ - private function getDefaultHttpClient() + protected function getDefaultHttpClient() { return new PluginClient( HttpClientDiscovery::find(), @@ -323,7 +323,7 @@ private function getDefaultHttpClient() /** * @return array */ - private function getRequestHeaders() + protected function getRequestHeaders() { return array_merge( [ @@ -340,7 +340,7 @@ private function getRequestHeaders() * * @return Authentication */ - private function getAuth() + protected function getAuth() { if (!empty($this->appIdOrToken) && !empty($this->passwordPart)) { return new BasicAuth($this->appIdOrToken, $this->passwordPart); @@ -356,7 +356,7 @@ private function getAuth() * * @return RequestInterface */ - private function authenticateRequest(RequestInterface $request) + protected function authenticateRequest(RequestInterface $request) { $auth = $this->getAuth(); return $auth ? $auth->authenticate($request) : $request; @@ -370,7 +370,7 @@ private function authenticateRequest(RequestInterface $request) * @return ResponseInterface * @throws ClientExceptionInterface */ - private function sendRequest($method, $uri, $body = null) + protected function sendRequest($method, $uri, $body = null) { $headers = $this->getRequestHeaders(); $body = is_array($body) ? json_encode($body) : $body; @@ -386,7 +386,7 @@ private function sendRequest($method, $uri, $body = null) * * @return stdClass */ - private function handleResponse(ResponseInterface $response) + protected function handleResponse(ResponseInterface $response) { $this->setRateLimitDetails($response); @@ -398,7 +398,7 @@ private function handleResponse(ResponseInterface $response) /** * @param ResponseInterface $response */ - private function setRateLimitDetails(ResponseInterface $response) + protected function setRateLimitDetails(ResponseInterface $response) { $this->rateLimitDetails = [ 'limit' => $response->hasHeader('X-RateLimit-Limit') From c6c05f63ec3332eb6657cdd4e7c3659738fc188a Mon Sep 17 00:00:00 2001 From: Luke Kuzmish Date: Wed, 5 Apr 2023 13:53:50 -0400 Subject: [PATCH 2/2] change property visibility from private to protected --- src/IntercomClient.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/IntercomClient.php b/src/IntercomClient.php index d6ce39f5..47d498bb 100644 --- a/src/IntercomClient.php +++ b/src/IntercomClient.php @@ -26,32 +26,32 @@ class IntercomClient /** * @var HttpClient $httpClient */ - private $httpClient; + protected $httpClient; /** * @var RequestFactory $requestFactory */ - private $requestFactory; + protected $requestFactory; /** * @var UriFactory $uriFactory */ - private $uriFactory; + protected $uriFactory; /** * @var string API user authentication */ - private $appIdOrToken; + protected $appIdOrToken; /** * @var string API password authentication */ - private $passwordPart; + protected $passwordPart; /** * @var array $extraRequestHeaders */ - private $extraRequestHeaders; + protected $extraRequestHeaders; /** * @var IntercomUsers $users