Passed
Pull Request — master (#71)
by Matthieu
06:41 queued 02:41
created
src/Resources/config/routing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 use AtlassianConnectBundle\Controller\UnlicensedController;
8 8
 use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
9 9
 
10
-return function (RoutingConfigurator $routes) {
10
+return function(RoutingConfigurator $routes) {
11 11
     $routes
12 12
         ->add('atlassian_connect_descriptor', '/atlassian-connect.json')
13 13
             ->controller([DescriptorController::class, 'indexAction'])
Please login to merge, or discard this patch.
src/Resources/config/services.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
25 25
 use Twig\Environment;
26 26
 
27
-return static function (ContainerConfigurator $container) {
27
+return static function(ContainerConfigurator $container) {
28 28
     $container->parameters()
29 29
         ->set('atlassian_connect_license_listener_class', LicenseListener::class)
30 30
         ->set('atlassian_connect_jwt_user_provider_class', JWTUserProvider::class)
Please login to merge, or discard this patch.
Tests/Service/GuzzleJWTMiddlewareTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Service/GuzzleJWTMiddleware.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.