@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | $request->expects($this->once()) |
40 | 40 | ->method('withHeader') |
41 | - ->with('Authorization', $this->callback(function (string $jwt): bool { |
|
41 | + ->with('Authorization', $this->callback(function(string $jwt): bool { |
|
42 | 42 | $this->assertSame('JWT', explode(' ', $jwt)[0]); |
43 | 43 | $jwt = JWT::decode(explode(' ', $jwt)[1], 'shared-secret', ['HS256']); |
44 | 44 | $this->assertSame('addon-key', $jwt->iss); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | })) |
48 | 48 | ->willReturn($request); |
49 | 49 | |
50 | - $invokable = $middleware(function (RequestInterface $request, array $options) { }); |
|
50 | + $invokable = $middleware(function(RequestInterface $request, array $options) { }); |
|
51 | 51 | |
52 | 52 | $invokable($request, ['tenant' => $this->getTenant(), 'user_id' => null]); |
53 | 53 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ->withConsecutive(['Accept', 'application/json'], ['Authorization', 'Bearer token']) |
76 | 76 | ->willReturn($request); |
77 | 77 | |
78 | - $invokable = $middleware(function (RequestInterface $request, array $options) { }); |
|
78 | + $invokable = $middleware(function(RequestInterface $request, array $options) { }); |
|
79 | 79 | |
80 | 80 | $invokable($request, ['tenant' => $this->getTenant(), 'user_id' => 'abc']); |
81 | 81 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->expectExceptionMessage('Tenant not provided!'); |
87 | 87 | |
88 | 88 | $middleware = GuzzleJWTMiddleware::middleware($this->createMock(ClientInterface::class)); |
89 | - $invokable = $middleware(function (RequestInterface $request, array $options) { }); |
|
89 | + $invokable = $middleware(function(RequestInterface $request, array $options) { }); |
|
90 | 90 | |
91 | 91 | $invokable($this->createMock(RequestInterface::class), []); |
92 | 92 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->expectExceptionMessage('Tenant is not set up as oath application. Install the app with "ACT_AS_USER" scope.'); |
98 | 98 | |
99 | 99 | $middleware = GuzzleJWTMiddleware::middleware($this->createMock(ClientInterface::class)); |
100 | - $invokable = $middleware(function (RequestInterface $request, array $options) { }); |
|
100 | + $invokable = $middleware(function(RequestInterface $request, array $options) { }); |
|
101 | 101 | |
102 | 102 | $tenant = $this->createMock(TenantInterface::class); |
103 | 103 | $tenant->method('getOauthClientId')->willReturn(null); |
@@ -13,8 +13,8 @@ |
||
13 | 13 | { |
14 | 14 | public static function middleware(ClientInterface $client): callable |
15 | 15 | { |
16 | - return static function (callable $handler) use ($client): callable { |
|
17 | - return static function (RequestInterface $request, array $options) use ($handler, $client) { |
|
16 | + return static function(callable $handler) use ($client): callable { |
|
17 | + return static function(RequestInterface $request, array $options) use ($handler, $client) { |
|
18 | 18 | if (!\array_key_exists('tenant', $options) || !$options['tenant'] instanceof TenantInterface) { |
19 | 19 | throw new \RuntimeException('Tenant not provided!'); |
20 | 20 | } |