From a01e6b51fc245754d0255a77bf5abd490d419958 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 27 Aug 2019 12:19:17 +0200 Subject: [PATCH] Type hinting (#284) --- src/IntercomAdmins.php | 2 +- src/IntercomBulk.php | 2 +- src/IntercomClient.php | 2 +- src/IntercomCompanies.php | 2 +- src/IntercomConversations.php | 2 +- src/IntercomCounts.php | 2 +- src/IntercomCustomers.php | 2 +- src/IntercomEvents.php | 2 +- src/IntercomLeads.php | 2 +- src/IntercomMessages.php | 2 +- src/IntercomNotes.php | 2 +- src/IntercomSegments.php | 2 +- src/IntercomTags.php | 2 +- src/IntercomUsers.php | 18 +++++++++--------- src/IntercomVisitors.php | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/IntercomAdmins.php b/src/IntercomAdmins.php index e837121..fda1ea0 100644 --- a/src/IntercomAdmins.php +++ b/src/IntercomAdmins.php @@ -18,7 +18,7 @@ class IntercomAdmins * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomBulk.php b/src/IntercomBulk.php index b035544..f5ee810 100644 --- a/src/IntercomBulk.php +++ b/src/IntercomBulk.php @@ -18,7 +18,7 @@ class IntercomBulk * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomClient.php b/src/IntercomClient.php index a15d967..253f21c 100644 --- a/src/IntercomClient.php +++ b/src/IntercomClient.php @@ -133,7 +133,7 @@ class IntercomClient * @param string|null $password Api Key. * @param array $extraRequestHeaders Extra request headers to be sent in every api request */ - public function __construct($appIdOrToken, $password = null, $extraRequestHeaders = []) + public function __construct(string $appIdOrToken, string $password = null, array $extraRequestHeaders = []) { $this->users = new IntercomUsers($this); $this->customers = new IntercomCustomers($this); diff --git a/src/IntercomCompanies.php b/src/IntercomCompanies.php index ae840d0..6230a97 100644 --- a/src/IntercomCompanies.php +++ b/src/IntercomCompanies.php @@ -18,7 +18,7 @@ class IntercomCompanies * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomConversations.php b/src/IntercomConversations.php index 158dbb7..7925123 100644 --- a/src/IntercomConversations.php +++ b/src/IntercomConversations.php @@ -18,7 +18,7 @@ class IntercomConversations * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomCounts.php b/src/IntercomCounts.php index b6db2a8..ff33dd0 100644 --- a/src/IntercomCounts.php +++ b/src/IntercomCounts.php @@ -18,7 +18,7 @@ class IntercomCounts * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomCustomers.php b/src/IntercomCustomers.php index 2863b9e..27b8400 100644 --- a/src/IntercomCustomers.php +++ b/src/IntercomCustomers.php @@ -18,7 +18,7 @@ class IntercomCustomers * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomEvents.php b/src/IntercomEvents.php index c02ad43..cdad1d2 100644 --- a/src/IntercomEvents.php +++ b/src/IntercomEvents.php @@ -18,7 +18,7 @@ class IntercomEvents * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomLeads.php b/src/IntercomLeads.php index 01cb6c3..42e199a 100644 --- a/src/IntercomLeads.php +++ b/src/IntercomLeads.php @@ -18,7 +18,7 @@ class IntercomLeads * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomMessages.php b/src/IntercomMessages.php index 8e2c7a4..211c28c 100644 --- a/src/IntercomMessages.php +++ b/src/IntercomMessages.php @@ -18,7 +18,7 @@ class IntercomMessages * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomNotes.php b/src/IntercomNotes.php index 009b15b..5b55c3b 100644 --- a/src/IntercomNotes.php +++ b/src/IntercomNotes.php @@ -18,7 +18,7 @@ class IntercomNotes * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomSegments.php b/src/IntercomSegments.php index 9c02109..a8dca75 100644 --- a/src/IntercomSegments.php +++ b/src/IntercomSegments.php @@ -18,7 +18,7 @@ class IntercomSegments * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomTags.php b/src/IntercomTags.php index b359b3f..fa2f35c 100644 --- a/src/IntercomTags.php +++ b/src/IntercomTags.php @@ -18,7 +18,7 @@ class IntercomTags * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } diff --git a/src/IntercomUsers.php b/src/IntercomUsers.php index 91eb030..7832706 100644 --- a/src/IntercomUsers.php +++ b/src/IntercomUsers.php @@ -18,7 +18,7 @@ class IntercomUsers * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; } @@ -31,7 +31,7 @@ public function __construct($client) * @return stdClass * @throws Exception */ - public function create($options) + public function create(array $options) { return $this->client->post("users", $options); } @@ -44,7 +44,7 @@ public function create($options) * @return stdClass * @throws Exception */ - public function update($options) + public function update(array $options) { return $this->create($options); } @@ -57,7 +57,7 @@ public function update($options) * @return stdClass * @throws Exception */ - public function getUsers($options) + public function getUsers(array $options) { return $this->client->get('users', $options); } @@ -85,7 +85,7 @@ public function getUser($id, $options = []) * @return stdClass * @throws Exception */ - public function scrollUsers($options = []) + public function scrollUsers(array $options = []) { return $this->client->get('users/scroll', $options); } @@ -99,7 +99,7 @@ public function scrollUsers($options = []) * @return stdClass * @throws Exception */ - public function archiveUser($id, $options = []) + public function archiveUser(string $id, array $options = []) { $path = $this->userPath($id); return $this->client->delete($path, $options); @@ -114,7 +114,7 @@ public function archiveUser($id, $options = []) * @return stdClass * @throws Exception */ - public function deleteUser($id, $options = []) + public function deleteUser(string $id, array $options = []) { return $this->archiveUser($id, $options); } @@ -127,7 +127,7 @@ public function deleteUser($id, $options = []) * @return stdClass * @throws Exception */ - public function permanentlyDeleteUser($id) + public function permanentlyDeleteUser(string $id) { return $this->client->post('user_delete_requests', [ 'intercom_user_id' => $id @@ -138,7 +138,7 @@ public function permanentlyDeleteUser($id) * @param string $id * @return string */ - public function userPath($id) + public function userPath(string $id) { return 'users/' . $id; } diff --git a/src/IntercomVisitors.php b/src/IntercomVisitors.php index 1157ff5..f425e03 100644 --- a/src/IntercomVisitors.php +++ b/src/IntercomVisitors.php @@ -18,7 +18,7 @@ class IntercomVisitors * * @param IntercomClient $client */ - public function __construct($client) + public function __construct(IntercomClient $client) { $this->client = $client; }