diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-09 08:52:14 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-09 08:52:14 +0100 |
commit | 5ad89371ed04d5d73e59f2c3e18a8562edb8e6ef (patch) | |
tree | f5a040238ea26408430eb5a8413e8261cdc395c8 /settings/Controller/ChangePasswordController.php | |
parent | d2a8dbeac67a3ddba7723e4f19eba6568e3b100a (diff) | |
download | nextcloud-server-5ad89371ed04d5d73e59f2c3e18a8562edb8e6ef.tar.gz nextcloud-server-5ad89371ed04d5d73e59f2c3e18a8562edb8e6ef.zip |
Make ChangePasswordController strict
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'settings/Controller/ChangePasswordController.php')
-rw-r--r-- | settings/Controller/ChangePasswordController.php | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/settings/Controller/ChangePasswordController.php b/settings/Controller/ChangePasswordController.php index 31ff8904ce3..208178d567d 100644 --- a/settings/Controller/ChangePasswordController.php +++ b/settings/Controller/ChangePasswordController.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * * @@ -26,12 +27,12 @@ */ namespace OC\Settings\Controller; +use OC\Group\Manager as GroupManager; use OC\HintException; use OC\User\Session; use OCP\App\IAppManager; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; -use OCP\IGroupManager; use OCP\IL10N; use OCP\IRequest; use OCP\IUser; @@ -49,7 +50,7 @@ class ChangePasswordController extends Controller { /** @var IL10N */ private $l; - /** @var IGroupManager */ + /** @var GroupManager */ private $groupManager; /** @var Session */ @@ -58,24 +59,12 @@ class ChangePasswordController extends Controller { /** @var IAppManager */ private $appManager; - /** - * ChangePasswordController constructor. - * - * @param string $appName - * @param IRequest $request - * @param $userId - * @param IUserManager $userManager - * @param IUserSession $userSession - * @param IGroupManager $groupManager - * @param IAppManager $appManager - * @param IL10N $l - */ - public function __construct($appName, + public function __construct(string $appName, IRequest $request, - $userId, + string $userId, IUserManager $userManager, IUserSession $userSession, - IGroupManager $groupManager, + GroupManager $groupManager, IAppManager $appManager, IL10N $l) { parent::__construct($appName, $request); @@ -98,7 +87,7 @@ class ChangePasswordController extends Controller { * * @return JSONResponse */ - public function changePersonalPassword($oldpassword = '', $newpassword = null) { + public function changePersonalPassword(string $oldpassword = '', string $newpassword = null): JSONResponse { /** @var IUser $user */ $user = $this->userManager->checkPassword($this->userId, $oldpassword); if ($user === false) { @@ -148,7 +137,7 @@ class ChangePasswordController extends Controller { * * @return JSONResponse */ - public function changeUserPassword($username = null, $password = null, $recoveryPassword = null) { + public function changeUserPassword(string $username = null, string $password = null, string $recoveryPassword = null): JSONResponse { if ($username === null) { return new JSONResponse([ 'status' => 'error', |