From a6dc4c1af492093d4fa887829b80574bec0479e3 Mon Sep 17 00:00:00 2001 From: Antoine <15737031+MinDBreaK@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:36:18 +0100 Subject: [PATCH 1/2] Update companies::update() Allow update method to update a specified company with an id. --- src/IntercomCompanies.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/IntercomCompanies.php b/src/IntercomCompanies.php index e3256ad9..00a169c2 100644 --- a/src/IntercomCompanies.php +++ b/src/IntercomCompanies.php @@ -28,9 +28,17 @@ public function create($options) * @return stdClass * @throws Exception */ - public function update($options) + public function update($id, array $options = null) { - return $this->create($options); + // BC layer + if (func_num_args() < 2 || is_array($id)) { + @trigger_deprecation('intercom/intercom-php', '4.4', 'Specify an id or use create method'); + + return $this->create($id); + } + + return $this->client->put($this->companyPath($id), $options); + } /** From 5928958d5a56b1dc5a040e666681e23f8989290a Mon Sep 17 00:00:00 2001 From: Antoine <15737031+MinDBreaK@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:42:02 +0100 Subject: [PATCH 2/2] Remove trigger_deprecation The function is a Symfony only function. --- src/IntercomCompanies.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IntercomCompanies.php b/src/IntercomCompanies.php index 00a169c2..72bcf5c0 100644 --- a/src/IntercomCompanies.php +++ b/src/IntercomCompanies.php @@ -31,14 +31,14 @@ public function create($options) public function update($id, array $options = null) { // BC layer + // TODO: Next Major : Remove this. if (func_num_args() < 2 || is_array($id)) { - @trigger_deprecation('intercom/intercom-php', '4.4', 'Specify an id or use create method'); + @trigger_error('Specify an id or use create method to update the company', E_USER_DEPRECATED); return $this->create($id); } return $this->client->put($this->companyPath($id), $options); - } /**