Skip to content

Commit

Permalink
Merge branch 'feature/issue-11' of github.com:dedoc/documentor into f…
Browse files Browse the repository at this point in the history
…eature/issue-11
  • Loading branch information
romalytvynenko committed Sep 20, 2022
2 parents b149af0 + 338a0e6 commit 37ab2e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Support/Generator/SecuritySchemes/OAuthFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@
class OAuthFlow
{
public string $authorizationUrl = '';

public string $tokenUrl = '';

public string $refreshUrl = '';

/** @var array<string, string> */
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;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Support/Generator/SecuritySchemes/OAuthFlows.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/OpenApiBuildersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'type' => 'apiKey',
'in' => 'query',
'name' => 'api_token',
]
],
]);
});

Expand Down

0 comments on commit 37ab2e2

Please sign in to comment.