From 7b8fba9ce5542eff0211860ab85e675036afeb81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20F=C3=B6rster?= Date: Sat, 25 Jan 2025 15:01:15 +0100 Subject: [PATCH] Fix return declarations @ example --- examples/README.md | 7 +++---- examples/src/Repositories/AuthCodeRepository.php | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/README.md b/examples/README.md index 8213e61c0..edc578516 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,12 +1,11 @@ -# Example implementations +# Example implementations (via [`Slim 3`](https://github.com/slimphp/Slim/tree/3.x)) ## Installation 0. Run `composer install` in this directory to install dependencies 0. Create a private key `openssl genrsa -out private.key 2048` -0. Create a public key `openssl rsa -in private.key -pubout > public.key` -0. `cd` into the public directory -0. Start a PHP server `php -S localhost:4444` +0. Export the public key `openssl rsa -in private.key -pubout > public.key` +0. Start local PHP server `php -S 127.0.0.1:4444 -t public/` ## Testing the client credentials grant example diff --git a/examples/src/Repositories/AuthCodeRepository.php b/examples/src/Repositories/AuthCodeRepository.php index 962ed8da9..4d21a30e7 100644 --- a/examples/src/Repositories/AuthCodeRepository.php +++ b/examples/src/Repositories/AuthCodeRepository.php @@ -21,7 +21,7 @@ class AuthCodeRepository implements AuthCodeRepositoryInterface /** * {@inheritdoc} */ - public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity) + public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity): void { // Some logic to persist the auth code to a database } @@ -29,7 +29,7 @@ public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity) /** * {@inheritdoc} */ - public function revokeAuthCode($codeId) + public function revokeAuthCode($codeId): void { // Some logic to revoke the auth code in a database } @@ -37,7 +37,7 @@ public function revokeAuthCode($codeId) /** * {@inheritdoc} */ - public function isAuthCodeRevoked($codeId) + public function isAuthCodeRevoked($codeId): bool { return false; // The auth code has not been revoked } @@ -45,7 +45,7 @@ public function isAuthCodeRevoked($codeId) /** * {@inheritdoc} */ - public function getNewAuthCode() + public function getNewAuthCode(): AuthCodeEntityInterface { return new AuthCodeEntity(); }