From b22dbbe6f3969a15664bfecc707b94c2197f33ea Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Mon, 25 Feb 2019 09:41:14 -0800 Subject: [PATCH] Official deprecation for User methods --- src/API/Management/Users.php | 79 ++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/src/API/Management/Users.php b/src/API/Management/Users.php index e977d282..1943dde7 100644 --- a/src/API/Management/Users.php +++ b/src/API/Management/Users.php @@ -155,24 +155,6 @@ public function getAll(array $params = [], $fields = null, $include_fields = nul ->call(); } - /** - * Wrapper for self::search(). - * - * TODO: Deprecate, replaced with getAll above. - * - * @param array $params Search parameters to send. - * - * @return mixed|string - * - * @throws \Exception Thrown by the HTTP client when there is a problem with the API call. - * - * @see self::getAll() - */ - public function search(array $params = []) - { - return $this->getAll($params); - } - /** * Delete a User by ID. * Required scope: "delete:users" @@ -240,22 +222,6 @@ public function unlinkAccount($user_id, $provider, $identity_id) ->call(); } - /** - * Unlink device. - * TODO: Deprecate, endpoint does not exist. - * - * @param string $user_id User ID. - * @param string $device_id Device ID. - * - * @return void - * - * @throws \Exception Thrown by the HTTP client when there is a problem with the API call. - */ - public function unlinkDevice($user_id, $device_id) - { - throw new \Exception('Endpoint /api/v2/users/{user_id}/devices/{device_id} does not exist.'); - } - /** * Delete the multifactor provider settings for a particular user. * This will force user to re-configure the multifactor provider. @@ -275,4 +241,49 @@ public function deleteMultifactorProvider($user_id, $mfa_provider) ->addPath('multifactor', $mfa_provider) ->call(); } + + /* + * Deprecated + */ + + // phpcs:disable + + /** + * Wrapper for self::getAll(). + * + * @deprecated 5.4.0, use $this->>getAll instead. + * + * @param array $params Search parameters to send. + * + * @return mixed|string + * + * @throws \Exception Thrown by the HTTP client when there is a problem with the API call. + * + * @codeCoverageIgnores - Deprecated + */ + public function search(array $params = []) + { + return $this->getAll($params); + } + + /** + * Unlink device. + * + * @deprecated 5.4.0, endpoint does not exist. + * + * @param string $user_id User ID. + * @param string $device_id Device ID. + * + * @return void + * + * @throws \Exception Thrown by the HTTP client when there is a problem with the API call. + * + * @codeCoverageIgnores - Deprecated + */ + public function unlinkDevice($user_id, $device_id) + { + throw new \Exception('Endpoint /api/v2/users/{user_id}/devices/{device_id} does not exist.'); + } + + // phpcs:enable }