Skip to content
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

Type hinting #284

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/IntercomAdmins.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomAdmins
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomBulk
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomCompanies.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomCompanies
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomConversations.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomConversations
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomCounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomCounts
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomCustomers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomCustomers
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomEvents
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomLeads.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomLeads
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomMessages
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomNotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomNotes
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomSegments.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomSegments
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomTags
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down
18 changes: 9 additions & 9 deletions src/IntercomUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomUsers
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
Expand All @@ -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);
}
Expand All @@ -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
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IntercomVisitors.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IntercomVisitors
*
* @param IntercomClient $client
*/
public function __construct($client)
public function __construct(IntercomClient $client)
{
$this->client = $client;
}
Expand Down