Skip to content

Commit

Permalink
Fix styleci issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephster committed Mar 22, 2023
1 parent ce7e35f commit ec7d98a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 9 deletions.
4 changes: 0 additions & 4 deletions examples/public/client_credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,16 @@
]);

$app->post('/access_token', function (ServerRequestInterface $request, ResponseInterface $response) use ($app) {

/* @var \League\OAuth2\Server\AuthorizationServer $server */
$server = $app->getContainer()->get(AuthorizationServer::class);

try {

// Try to respond to the request
return $server->respondToAccessTokenRequest($request, $response);
} catch (OAuthServerException $exception) {

// All instances of OAuthServerException can be formatted into a HTTP response
return $exception->generateHttpResponse($response);
} catch (\Exception $exception) {

// Unknown exception
$body = new Stream('php://temp', 'r+');
$body->write($exception->getMessage());
Expand Down
5 changes: 0 additions & 5 deletions examples/public/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
$app = new App([
// Add the authorization server to the DI container
AuthorizationServer::class => function () {

// Setup the authorization server
$server = new AuthorizationServer(
new ClientRepository(), // instance of ClientRepositoryInterface
Expand Down Expand Up @@ -46,20 +45,16 @@
$app->post(
'/access_token',
function (ServerRequestInterface $request, ResponseInterface $response) use ($app) {

/* @var \League\OAuth2\Server\AuthorizationServer $server */
$server = $app->getContainer()->get(AuthorizationServer::class);

try {

// Try to respond to the access token request
return $server->respondToAccessTokenRequest($request, $response);
} catch (OAuthServerException $exception) {

// All instances of OAuthServerException can be converted to a PSR-7 response
return $exception->generateHttpResponse($response);
} catch (\Exception $exception) {

// Catch unexpected exceptions
$body = $response->getBody();
$body->write($exception->getMessage());
Expand Down
1 change: 1 addition & 0 deletions src/Entities/Traits/ClientTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ trait ClientTrait
* Get the client's name.
*
* @return string
*
* @codeCoverageIgnore
*/
public function getName()
Expand Down
1 change: 1 addition & 0 deletions src/RequestAccessTokenEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct($name, ServerRequestInterface $request, AccessTokenE

/**
* @return AccessTokenEntityInterface
*
* @codeCoverageIgnore
*/
public function getAccessToken()
Expand Down
1 change: 1 addition & 0 deletions src/RequestEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function __construct($name, ServerRequestInterface $request)

/**
* @return ServerRequestInterface
*
* @codeCoverageIgnore
*/
public function getRequest()
Expand Down
1 change: 1 addition & 0 deletions src/RequestRefreshTokenEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct($name, ServerRequestInterface $request, RefreshToken

/**
* @return RefreshTokenEntityInterface
*
* @codeCoverageIgnore
*/
public function getRefreshToken()
Expand Down

0 comments on commit ec7d98a

Please sign in to comment.