diff --git a/CHANGES.md b/CHANGES.md index 46d2c4b..a6bf6c9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,29 @@ # CHANGELOG +## 2.0.0 (2020-06-30) +* Upgrade minimum PHP version to 7.1 +* BC BREAK: review naming of all functions in all endpoint to simplify them: + * list + * get + * update + * create + * search + * link + * ... + +Eg: +``` +# Before +$client->users->getUsers; +$client->users->getUser('155468'); + +# After + +$client->users->list(); +$client->users->get('155468'); +``` + + ## 1.1.0 (2020-06-30) * Fix AircallCalls::comment diff --git a/README.md b/README.md index 94bed02..2905b05 100644 --- a/README.md +++ b/README.md @@ -44,58 +44,58 @@ $client->ping(); ```php // Get generic data about the account -$client->company->getCompany(); +$client->company->get(); ``` ### Users ```php // Get a user by ID -$client->users->getUser('155468'); +$client->users->get('155468'); // List all users -$client->users->getUsers(); +$client->users->list(); ``` ### Calls ```php // Get a call by ID -$client->calls->getCall('155468'); +$client->calls->get('155468'); // List all calls -$client->calls->getCalls(); +$client->calls->list(); // Search calls -$client->calls->searchCalls([ +$client->calls->search([ 'tags' => 'myTag', ]); // Display a link in-app to the User who answered a specific Call. -$client->calls->linkCall('155468', [ +$client->calls->link('155468', [ 'link' => 'http://something.io/mypage' ]); // Transfer the Call to another user. -$client->calls->transfertCall('1644658', [ +$client->calls->transfert('1644658', [ 'user_id' => '8945487' ]); // Delete the recording of a specific Call. -$client->calls->deleteRecordingCall('795312'); +$client->calls->deleteRecording('795312'); // Delete the voicemail of a specific Call. -$client->calls->deleteVoicemailCall('13877988'); +$client->calls->deleteVoicemail('13877988'); ``` ### Contacts ```php // List all contacts -$client->contacts->getContacts(); +$client->contacts->list(); // Get a contact by ID -$client->contacts->getContact('699421'); +$client->contacts->get('699421'); // Create a contact $client->contacts->create([ @@ -117,7 +117,7 @@ $client->contacts->create([ ]); // Search contacts -$client->contacts->searchContacts([ +$client->contacts->search([ 'phone_number' => '+33631000000', 'email' => 'john.doe@something.io' ]); diff --git a/composer.json b/composer.json index 362fd3f..980d4e5 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ }, "require": { "guzzlehttp/guzzle": "~6.0", - "php": ">= 5.6" + "php": ">= 7.1" }, "require-dev": { "phpunit/phpunit": "4.0.*" diff --git a/src/AircallCalls.php b/src/AircallCalls.php index 4550038..40e070d 100644 --- a/src/AircallCalls.php +++ b/src/AircallCalls.php @@ -33,13 +33,13 @@ public function __construct($client) * * @return mixed */ - public function getCalls($options) + public function list($options) { return $this->client->get(self::BASE_ENDPOINT, $options); } /** - * Gets a single Call with their ID. + * Retrieve a single Call. * * @param int $id * @@ -47,7 +47,7 @@ public function getCalls($options) * * @return mixed */ - public function getCall($id) + public function get($id) { $path = $this->callPath($id); @@ -63,7 +63,7 @@ public function getCall($id) * * @return mixed */ - public function searchCalls($options = []) + public function search($options = []) { return $this->client->get(self::BASE_ENDPOINT.'/search', $options); } @@ -80,7 +80,7 @@ public function searchCalls($options = []) * * @return mixed */ - public function linkCall($id, $options = []) + public function link($id, $options = []) { $path = $this->callPath($id); @@ -97,7 +97,7 @@ public function linkCall($id, $options = []) * * @return mixed */ - public function transfertCall($id, $options = []) + public function transfert($id, $options = []) { $path = $this->callPath($id); @@ -200,7 +200,7 @@ public function setTags($id, $options = []) * * @return mixed */ - public function deleteRecordingCall($id) + public function deleteRecording($id) { $path = $this->callPath($id); @@ -217,7 +217,7 @@ public function deleteRecordingCall($id) * * @return mixed */ - public function deleteVoicemailCall($id, $options = []) + public function deleteVoicemail($id, $options = []) { $path = $this->callPath($id); diff --git a/src/AircallCompany.php b/src/AircallCompany.php index 524ee34..6d7df50 100644 --- a/src/AircallCompany.php +++ b/src/AircallCompany.php @@ -31,7 +31,7 @@ public function __construct($client) * * @return mixed */ - public function getCompany($options = []) + public function get($options = []) { return $this->client->get(self::BASE_ENDPOINT, $options); } diff --git a/src/AircallContacts.php b/src/AircallContacts.php index 050c29b..208f223 100644 --- a/src/AircallContacts.php +++ b/src/AircallContacts.php @@ -33,13 +33,13 @@ public function __construct($client) * * @return mixed */ - public function getContacts($options = []) + public function list($options = []) { return $this->client->get(self::BASE_ENDPOINT, $options); } /** - * Gets a single Contact with their ID. + * Retrieve a single Contact. * * @param int $id * @@ -47,7 +47,7 @@ public function getContacts($options = []) * * @return mixed */ - public function getContact($id) + public function get($id) { $path = $this->contactPath($id); @@ -110,7 +110,7 @@ public function delete($id) * * @return mixed */ - public function searchContacts($options = []) + public function search($options = []) { return $this->client->get(self::BASE_ENDPOINT.'/search', $options); } diff --git a/src/AircallNumbers.php b/src/AircallNumbers.php index 01a9398..81bfc2d 100644 --- a/src/AircallNumbers.php +++ b/src/AircallNumbers.php @@ -33,13 +33,13 @@ public function __construct($client) * * @return mixed */ - public function getNumbers($options = []) + public function list($options = []) { return $this->client->get(self::BASE_ENDPOINT, $options); } /** - * Gets a single Number with their ID. + * Retrieve a Number. * * @param int $id * @@ -47,7 +47,7 @@ public function getNumbers($options = []) * * @return mixed */ - public function getNumber($id) + public function get($id) { $path = $this->numberPath($id); @@ -55,7 +55,7 @@ public function getNumber($id) } /** - * Update a single Number with their ID. + * Update a single Number. * * @param int $id * @param array $options @@ -64,7 +64,7 @@ public function getNumber($id) * * @return mixed */ - public function updateNumber($id, $options = []) + public function update($id, $options = []) { $path = $this->numberPath($id); diff --git a/src/AircallTags.php b/src/AircallTags.php index aa6ec0c..0d82494 100644 --- a/src/AircallTags.php +++ b/src/AircallTags.php @@ -31,13 +31,13 @@ public function __construct($client) * * @return mixed */ - public function getTags($options = []) + public function list($options = []) { return $this->client->get(self::BASE_ENDPOINT, $options); } /** - * Retrieve a Tag with their ID. + * Retrieve a Tag. * * @param int $id * @@ -45,7 +45,7 @@ public function getTags($options = []) * * @return mixed */ - public function getTag($id) + public function get($id) { $path = $this->tagPath($id); diff --git a/src/AircallUsers.php b/src/AircallUsers.php index f44d98e..c4f3c8a 100644 --- a/src/AircallUsers.php +++ b/src/AircallUsers.php @@ -33,13 +33,13 @@ public function __construct($client) * * @return mixed */ - public function getUsers($options = []) + public function list($options = []) { return $this->client->get(self::BASE_ENDPOINT, $options); } /** - * Gets a single User with their ID. + * Retrieve a single User. * * @param int $id * @@ -47,7 +47,7 @@ public function getUsers($options = []) * * @return mixed */ - public function getUser($id) + public function get($id) { $path = $this->userPath($id); @@ -55,7 +55,7 @@ public function getUser($id) } /** - * Start an outbound call for a specific User. + * Start an outbound call. * * @param int $id * diff --git a/src/AircallWebhooks.php b/src/AircallWebhooks.php index e9e800a..79f5aee 100644 --- a/src/AircallWebhooks.php +++ b/src/AircallWebhooks.php @@ -31,7 +31,7 @@ public function __construct($client) * * @return mixed */ - public function getWebhooks($options = []) + public function list($options = []) { return $this->client->get(self::BASE_ENDPOINT, $options); } @@ -59,7 +59,7 @@ public function create($options = []) * * @return mixed */ - public function getWebhook($id) + public function get($id) { $path = $this->webhookPath($id);