Passed
Pull Request — master (#30)
by Daniel
03:08
created
tests/OAuthMiddlewareTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use CommerceGuys\Guzzle\Oauth2\Tests\MockOAuth2Server;
10 10
 use CommerceGuys\Guzzle\Oauth2\Tests\MockOAuthMiddleware;
11 11
 use CommerceGuys\Guzzle\Oauth2\Tests\TestBase;
12
-use GuzzleHttp\HandlerStack;
13 12
 use GuzzleHttp\RequestOptions;
14 13
 use Psr\Http\Message\ResponseInterface;
15 14
 
Please login to merge, or discard this patch.
tests/MockOAuth2Server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
                 array_fill(
48 48
                     0,
49 49
                     $this->options[self::KEY_EXPECTED_QUERY_COUNT],
50
-                    function (RequestInterface $request, array $options) {
50
+                    function(RequestInterface $request, array $options) {
51 51
                         return $this->getResult($request, $options);
52 52
                     }
53 53
                 )
Please login to merge, or discard this patch.
tests/MockOAuthMiddleware.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@
 block discarded – undo
50 50
     {
51 51
         $calls = 0;
52 52
 
53
-        return function (callable $handler) use (&$calls) {
54
-            return function (RequestInterface $request, array $options) use ($handler, &$calls) {
53
+        return function(callable $handler) use (&$calls) {
54
+            return function(RequestInterface $request, array $options) use ($handler, &$calls) {
55 55
                 /** @var PromiseInterface */
56 56
                 $promise = $handler($request, $options);
57 57
                 return $promise->then(
58
-                    function (ResponseInterface $response) use ($request, $options, &$calls) {
58
+                    function(ResponseInterface $response) use ($request, $options, &$calls) {
59 59
                         if (
60 60
                             isset($this->options[self::KEY_TOKEN_EXPIRED_ON_FAILURE_COUNT]) &&
61 61
                             isset($options['auth']) &&
Please login to merge, or discard this patch.
tests/GrantType/JwtBearerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         $grantType = new JwtBearer($this->createClient(), [
39 39
             'client_id' => 'testClient',
40 40
             'client_secret' => 'clientSecret',
41
-            'private_key' => new SplFileObject(__DIR__ . '/../private.key')
41
+            'private_key' => new SplFileObject(__DIR__.'/../private.key')
42 42
         ]);
43 43
         $token = $grantType->getToken();
44 44
         $this->assertNotEmpty($token->getToken());
Please login to merge, or discard this patch.
src/Middleware/OAuthMiddleware.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function onBefore()
58 58
     {
59
-        return function (callable $handler) {
60
-            return function (RequestInterface $request, array $options) use ($handler) {
59
+        return function(callable $handler) {
60
+            return function(RequestInterface $request, array $options) use ($handler) {
61 61
                 if (
62 62
                     isset($options['auth']) &&
63 63
                     'oauth2' == $options['auth'] &&
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $calls = 0;
81 81
 
82
-        return function (callable $handler) use (&$calls, $limit) {
83
-            return function (RequestInterface $request, array $options) use ($handler, &$calls, $limit) {
82
+        return function(callable $handler) use (&$calls, $limit) {
83
+            return function(RequestInterface $request, array $options) use ($handler, &$calls, $limit) {
84 84
                 /* @var PromiseInterface */
85 85
                 $promise = $handler($request, $options);
86 86
 
87 87
                 return $promise->then(
88
-                    function (ResponseInterface $response) use ($request, $options, &$calls, $limit) {
88
+                    function(ResponseInterface $response) use ($request, $options, &$calls, $limit) {
89 89
                         if (
90 90
                             $response->getStatusCode() == 401 &&
91 91
                             isset($options['auth']) &&
Please login to merge, or discard this patch.