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

Official deprecation for User methods #327

Merged
merged 2 commits into from
Feb 25, 2019
Merged
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
79 changes: 45 additions & 34 deletions src/API/Management/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand All @@ -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
}