From 5b319efc4b98f511797d7969f77c1eb39fda4524 Mon Sep 17 00:00:00 2001 From: Maxime Horcholle Date: Mon, 13 Feb 2017 16:16:58 +0100 Subject: [PATCH] docs: simplify checkGrantExtension code --- Resources/doc/adding_grant_extensions.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Resources/doc/adding_grant_extensions.md b/Resources/doc/adding_grant_extensions.md index 2a3cfc7c..2e0352d6 100644 --- a/Resources/doc/adding_grant_extensions.md +++ b/Resources/doc/adding_grant_extensions.md @@ -29,7 +29,7 @@ use OAuth2\Model\IOAuth2Client; */ class BingoGrantExtension implements GrantExtensionInterface { - /* + /** * {@inheritdoc} */ public function checkGrantExtension(IOAuth2Client $client, array $inputData, array $authHeaders) @@ -42,10 +42,6 @@ class BingoGrantExtension implements GrantExtensionInterface $numberToGuess1 = rand(0, 100); $numberToGuess2 = rand(0, 100); - if ($numberToGuess1 != $inputData['number_1'] && $numberToGuess2 != $inputData['number_2']) { - return false; // No number guessed, grant will fail - } - if ($numberToGuess1 == $inputData['number_1'] && $numberToGuess2 == $inputData['number_2']) { // Both numbers were guessed, we grant an access_token linked // to a user