Passed
Push — master ( 5ed34a...340187 )
by Alexandre
02:40
created
src/OAuth2/EndpointMessages/Token/AccessTokenResponse.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 
11 11
 
12 12
 use GuzzleHttp\Psr7\Response;
13
-use Psr\Http\Message\UriInterface;
14 13
 
15 14
 /**
16 15
  * Class AccessTokenResponse
Please login to merge, or discard this patch.
src/OAuth2/EndpointMessages/Token/ErrorResponse.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,6 @@
 block discarded – undo
10 10
 
11 11
 
12 12
 use GuzzleHttp\Psr7\Response;
13
-use GuzzleHttp\Psr7\Uri;
14
-use Psr\Http\Message\UriInterface;
15 13
 
16 14
 class ErrorResponse extends Response
17 15
 {
Please login to merge, or discard this patch.
src/OAuth2/OpenID/ResponseTypes/CodeResponseType.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 use OAuth2\Config;
13 13
 use OAuth2\Exceptions\OAuthException;
14 14
 use OAuth2\Repositories\ConfigurationRepository;
15
-use OAuth2\ResponseTypes\ResponseTypeInterface;
16 15
 use OAuth2\Roles\Clients\RegisteredClient;
17 16
 use OAuth2\Roles\ResourceOwnerInterface;
18 17
 use OAuth2\Storages\AuthorizationCodeStorageInterface;
Please login to merge, or discard this patch.
src/Old/Endpoint/Server/Authorization.php 2 patches
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -10,20 +10,16 @@
 block discarded – undo
10 10
 
11 11
 use GuzzleHttp\Psr7\Response;
12 12
 use GuzzleHttp\Psr7\Uri;
13
-use OAuth2\Credential\AuthorizationCode;
14 13
 use OAuth2\Endpoint\Config;
15 14
 use OAuth2\Endpoint\Endpoint;
16 15
 use OAuth2\Endpoint\Server\Messages\Authorization\AuthorizationRequest as AuthorizationRequest;
17
-use OAuth2\Endpoint\Server\Messages\Authorization\AuthorizationResponse as AuthorizationResponse;
18 16
 use OAuth2\Endpoint\Server\Messages\Authorization\ErrorResponse;
19 17
 use OAuth2\Exception\MissingResourceOwnerDecision;
20 18
 use OAuth2\Exception\ResourceOwnerNotAuthenticatedException;
21 19
 use OAuth2\ResponseType\ResponseTypeInterface;
22
-use OAuth2\Storage\ClientStorage;
23 20
 use OAuth2\Role\Client\RegisteredClient;
24 21
 use OAuth2\Role\Client\Type\ClientPassword;
25 22
 use OAuth2\Role\Client\Type\PublicClient;
26
-use OAuth2\Role\Client\WebApplication;
27 23
 use OAuth2\Role\ResourceOwner;
28 24
 
29 25
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -238,8 +238,7 @@
 block discarded – undo
238 238
 
239 239
         if($isImplicitResponseType) {
240 240
             $redirectUri = $redirectUri->withFragment(http_build_query($params));
241
-        }
242
-        else {
241
+        } else {
243 242
             foreach ($params as $key => $value) {
244 243
                 $redirectUri = Uri::withQueryValue($redirectUri, $key, $value);
245 244
             }
Please login to merge, or discard this patch.
src/Old/Endpoint/Server/Server.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,6 @@
 block discarded – undo
18 18
 use OAuth2\Storage\AuthorizationCodeStorage;
19 19
 use OAuth2\Storage\ClientStorage;
20 20
 use OAuth2\Role\Client\RegisteredClient;
21
-use OAuth2\Role\Client\Type\ClientPassword;
22 21
 use Psr\Http\Message\ServerRequestInterface;
23 22
 
24 23
 class Server
Please login to merge, or discard this patch.
src/Old/Endpoint/Server/Token.php 2 patches
Unused Use Statements   -8 removed lines patch added patch discarded remove patch
@@ -11,19 +11,11 @@
 block discarded – undo
11 11
 use GuzzleHttp\Psr7\Uri;
12 12
 use OAuth2\Credential\AccessToken;
13 13
 use OAuth2\Credential\RefreshToken;
14
-use OAuth2\Credential\TokenType\BearerToken;
15
-use OAuth2\Endpoint\Config;
16 14
 use OAuth2\Endpoint\Server\Messages\AccessToken\AccessTokenRequest;
17 15
 use OAuth2\Endpoint\Server\Messages\AccessToken\AccessTokenResponse;
18
-use OAuth2\Endpoint\Server\Messages\Authorization\AuthorizationRequest;
19 16
 use OAuth2\Endpoint\Server\Messages\AccessToken\ErrorResponse;
20
-use OAuth2\GrantType\AuthorizationCode;
21 17
 use OAuth2\GrantType\InvalidGrantType;
22
-use OAuth2\Storage\ClientStorage;
23 18
 use OAuth2\Role\Client;
24
-use OAuth2\Role\Client\RegisteredClient;
25
-use OAuth2\Role\Client\Type\ClientPassword;
26
-use Psr\Http\Message\ServerRequestInterface;
27 19
 
28 20
 
29 21
 /**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,8 +166,7 @@
 block discarded – undo
166 166
 
167 167
         try {
168 168
             $redirectUri = $grantType->grant($request, $client);
169
-        }
170
-        catch(InvalidGrantType $e) {
169
+        } catch(InvalidGrantType $e) {
171 170
             return new ErrorResponse('invalid_grant', $e->getErrorDescription(), $e->getErrorUri());
172 171
         }
173 172
 
Please login to merge, or discard this patch.
src/Old/GrantType/AuthorizationCode.php 1 patch
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -8,15 +8,10 @@
 block discarded – undo
8 8
 
9 9
 namespace OAuth2\GrantType;
10 10
 use OAuth2\Endpoint\Server\Messages\AccessToken\AccessTokenRequest;
11
-use OAuth2\Endpoint\Server\Messages\AccessToken\ErrorResponse;
12 11
 use OAuth2\Endpoint\Server\Messages\Authorization\AuthorizationRequest;
13 12
 use OAuth2\Endpoint\Server\Messages\Authorization\AuthorizationResponse;
14
-use OAuth2\Endpoint\Server\Server;
15
-use OAuth2\Role\Client;
16 13
 use OAuth2\Role\Client\RegisteredClient;
17
-use OAuth2\Storage\AuthorizationCodeStorage;
18 14
 use OAuth2\Storages\AuthorizationCodeStorageInterface;
19
-use Psr\Http\Message\ServerRequestInterface;
20 15
 
21 16
 /**
22 17
  * Class AuthorizationCode
Please login to merge, or discard this patch.
src/OAuth2/Endpoints/TokenEndpoint.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@
 block discarded – undo
96 96
 
97 97
         try {
98 98
             return $grantType->grant($request, $client);
99
-        }
100
-        catch (OAuthException $e) {
99
+        } catch (OAuthException $e) {
101 100
             return new ErrorResponse($e->getError(),
102 101
                 $e->getErrorDescription(),
103 102
                 $e->getErrorUri());
Please login to merge, or discard this patch.
src/OAuth2/GrantTypes/ResourceOwnerPasswordCredentialsGrantType.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@
 block discarded – undo
85 85
 
86 86
         try {
87 87
             $resourceOwner = $this->resourceOwnerProvider->authenticate($username, $password);
88
-        }
89
-        catch (\Exception $e) {
88
+        } catch (\Exception $e) {
90 89
             throw new OAuthException('invalid_grant', $e->getMessage(),
91 90
                 'https://tools.ietf.org/html/rfc6749#section-4.3');
92 91
         }
Please login to merge, or discard this patch.