From 3b70f512697d23beff5af972e3a78a6afe0e0498 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 14 Jun 2021 09:18:31 -0500 Subject: [PATCH] fix: revert changes to typehints in public API Since `BcryptTrait` is a public API, changes to its method signatures can have a BC impact. In particular, the change to `checkPassword` for 1.7.0 was incorrect, as `$user` is an array, and because the signature is intended to match those in the oauth2-server sources. Additionally, some of the parameter annotations in oauth2-server class extensions were incorrect, and have been updated. Fixes #36 Signed-off-by: Matthew Weier O'Phinney --- src/Adapter/BcryptTrait.php | 6 +++++- src/Adapter/MongoAdapter.php | 2 +- src/Adapter/PdoAdapter.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Adapter/BcryptTrait.php b/src/Adapter/BcryptTrait.php index a4c45fd..acabbc5 100644 --- a/src/Adapter/BcryptTrait.php +++ b/src/Adapter/BcryptTrait.php @@ -40,8 +40,12 @@ public function setBcryptCost($value) /** * Check password using bcrypt + * + * @param array $user + * @param string $password + * @return bool */ - protected function checkPassword(string $user, string $password): bool + protected function checkPassword($user, $password) { return $this->verifyHash($password, $user['password']); } diff --git a/src/Adapter/MongoAdapter.php b/src/Adapter/MongoAdapter.php index 8262933..9c03150 100644 --- a/src/Adapter/MongoAdapter.php +++ b/src/Adapter/MongoAdapter.php @@ -49,7 +49,7 @@ public function setBcryptCost($value) /** * Check password using bcrypt * - * @param string $user + * @param array $user * @param string $password * @return bool */ diff --git a/src/Adapter/PdoAdapter.php b/src/Adapter/PdoAdapter.php index 321b476..36a85cc 100644 --- a/src/Adapter/PdoAdapter.php +++ b/src/Adapter/PdoAdapter.php @@ -46,7 +46,7 @@ public function setBcryptCost($value) /** * Check password using bcrypt * - * @param string $user + * @param array $user * @param string $password * @return bool */