From 338a0e679f35e8835db9c97878f6f77fc5be7d5b Mon Sep 17 00:00:00 2001 From: romalytvynenko Date: Tue, 20 Sep 2022 20:42:44 +0000 Subject: [PATCH] Fix styling --- src/Support/Generator/SecuritySchemes/OAuthFlow.php | 6 ++++++ src/Support/Generator/SecuritySchemes/OAuthFlows.php | 7 +++++++ tests/OpenApiBuildersTest.php | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Support/Generator/SecuritySchemes/OAuthFlow.php b/src/Support/Generator/SecuritySchemes/OAuthFlow.php index 856e814c..035ca09c 100644 --- a/src/Support/Generator/SecuritySchemes/OAuthFlow.php +++ b/src/Support/Generator/SecuritySchemes/OAuthFlow.php @@ -5,26 +5,32 @@ class OAuthFlow { public string $authorizationUrl = ''; + public string $tokenUrl = ''; + public string $refreshUrl = ''; + /** @var array */ public array $scopes = []; public function authorizationUrl(string $authorizationUrl): OAuthFlow { $this->authorizationUrl = $authorizationUrl; + return $this; } public function tokenUrl(string $tokenUrl): OAuthFlow { $this->tokenUrl = $tokenUrl; + return $this; } public function refreshUrl(string $refreshUrl): OAuthFlow { $this->refreshUrl = $refreshUrl; + return $this; } diff --git a/src/Support/Generator/SecuritySchemes/OAuthFlows.php b/src/Support/Generator/SecuritySchemes/OAuthFlows.php index 3ace27b6..b4b50e33 100644 --- a/src/Support/Generator/SecuritySchemes/OAuthFlows.php +++ b/src/Support/Generator/SecuritySchemes/OAuthFlows.php @@ -5,31 +5,38 @@ class OAuthFlows { public ?OAuthFlow $implicit = null; + public ?OAuthFlow $password = null; + public ?OAuthFlow $clientCredentials = null; + public ?OAuthFlow $authorizationCode = null; public function implicit(?OAuthFlow $flow): OAuthFlows { $this->implicit = $flow; + return $this; } public function password(?OAuthFlow $flow): OAuthFlows { $this->password = $flow; + return $this; } public function clientCredentials(?OAuthFlow $flow): OAuthFlows { $this->clientCredentials = $flow; + return $this; } public function authorizationCode(?OAuthFlow $flow): OAuthFlows { $this->authorizationCode = $flow; + return $this; } diff --git a/tests/OpenApiBuildersTest.php b/tests/OpenApiBuildersTest.php index f7a7a920..bf46ed43 100644 --- a/tests/OpenApiBuildersTest.php +++ b/tests/OpenApiBuildersTest.php @@ -19,7 +19,7 @@ 'type' => 'apiKey', 'in' => 'query', 'name' => 'api_token', - ] + ], ]); });