@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | setlocale(\LC_ALL, 'en_US.UTF-8'); |
11 | 11 | |
12 | -$file = __DIR__ . '/../vendor/autoload.php'; |
|
12 | +$file = __DIR__.'/../vendor/autoload.php'; |
|
13 | 13 | |
14 | 14 | if (!file_exists($file)) { |
15 | 15 | throw new RuntimeException('Install dependencies using Composer to run the test suite.'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $middleware = GuzzleJWTMiddleware::authTokenMiddleware('atlassian-connect', 'secret'); |
29 | 29 | |
30 | - $invokable = $middleware(function (Request $request, array $options) { |
|
30 | + $invokable = $middleware(function(Request $request, array $options) { |
|
31 | 31 | $this->assertTrue($request->hasHeader('Authorization')); |
32 | 32 | $this->assertTrue($request->hasHeader('existing-header')); |
33 | 33 | $this->assertSame('GET', $request->getMethod()); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'username' |
60 | 60 | ); |
61 | 61 | |
62 | - $invokable = $middleware(function (Request $request, array $options) { |
|
62 | + $invokable = $middleware(function(Request $request, array $options) { |
|
63 | 63 | $this->assertSame('application/json', $request->getHeader('Accept')[0]); |
64 | 64 | $this->assertSame('Bearer token', $request->getHeader('Authorization')[0]); |
65 | 65 | $this->assertEquals(new Uri('https://atlassian.io/api/test'), $request->getUri()); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function testUnlicensedAction(): void |
15 | 15 | { |
16 | 16 | $loader = new FilesystemLoader(); |
17 | - $loader->addPath(__DIR__ . '/../../src/Resources/views', 'AtlassianConnect'); |
|
17 | + $loader->addPath(__DIR__.'/../../src/Resources/views', 'AtlassianConnect'); |
|
18 | 18 | |
19 | 19 | $twig = new Environment($loader, [ |
20 | 20 | 'debug' => true, |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | |
46 | 46 | public function getCacheDir(): string |
47 | 47 | { |
48 | - return sys_get_temp_dir() . '/com.github.thecatontheflat.atlassian/tests/var/cache'; |
|
48 | + return sys_get_temp_dir().'/com.github.thecatontheflat.atlassian/tests/var/cache'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | public function getLogDir(): string |
52 | 52 | { |
53 | - return sys_get_temp_dir() . '/com.github.thecatontheflat.atlassian/tests/var' . $this->environment . '/log'; |
|
53 | + return sys_get_temp_dir().'/com.github.thecatontheflat.atlassian/tests/var'.$this->environment.'/log'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void |
57 | 57 | { |
58 | - $configDir = $this->getProjectDir() . '/config'; |
|
58 | + $configDir = $this->getProjectDir().'/config'; |
|
59 | 59 | |
60 | 60 | if (BaseKernel::VERSION_ID >= 50400) { |
61 | - $loader->load($configDir . '/{base}/*.yaml', 'glob'); |
|
61 | + $loader->load($configDir.'/{base}/*.yaml', 'glob'); |
|
62 | 62 | } else { |
63 | - $loader->load($configDir . '/{base_old}/*.yaml', 'glob'); |
|
63 | + $loader->load($configDir.'/{base_old}/*.yaml', 'glob'); |
|
64 | 64 | } |
65 | 65 | |
66 | - $loader->load($configDir . '/{packages}/*.yaml', 'glob'); |
|
67 | - $loader->load($configDir . '/{services}.yaml', 'glob'); |
|
66 | + $loader->load($configDir.'/{packages}/*.yaml', 'glob'); |
|
67 | + $loader->load($configDir.'/{services}.yaml', 'glob'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | protected function build(ContainerBuilder $container): void |
@@ -79,6 +79,6 @@ discard block |
||
79 | 79 | */ |
80 | 80 | protected function configureRoutes($routes) |
81 | 81 | { |
82 | - $routes->import($this->getProjectDir() . '/config/routes.yaml'); |
|
82 | + $routes->import($this->getProjectDir().'/config/routes.yaml'); |
|
83 | 83 | } |
84 | 84 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | public function testProtectedRouteWithBearerToken(): void |
26 | 26 | { |
27 | - $client = self::createClient([], ['HTTP_AUTHORIZATION' => 'Bearer ' . $this->getTenantJWTCode()]); |
|
27 | + $client = self::createClient([], ['HTTP_AUTHORIZATION' => 'Bearer '.$this->getTenantJWTCode()]); |
|
28 | 28 | |
29 | 29 | $client->request('GET', '/protected/route'); |
30 | 30 | $this->assertResponseIsSuccessful(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $client = self::createClient(); |
36 | 36 | |
37 | - $client->request('GET', '/protected/route?jwt=' . $this->getTenantJWTCode()); |
|
37 | + $client->request('GET', '/protected/route?jwt='.$this->getTenantJWTCode()); |
|
38 | 38 | $this->assertResponseIsSuccessful(); |
39 | 39 | } |
40 | 40 |
@@ -24,8 +24,8 @@ |
||
24 | 24 | public static function generateAssertion(string $secret, string $oauthClientId, string $baseUrl, string $user): string |
25 | 25 | { |
26 | 26 | $data = [ |
27 | - 'iss' => 'urn:atlassian:connect:clientid:' . $oauthClientId, |
|
28 | - 'sub' => 'urn:atlassian:connect:useraccountid:' . $user, |
|
27 | + 'iss' => 'urn:atlassian:connect:clientid:'.$oauthClientId, |
|
28 | + 'sub' => 'urn:atlassian:connect:useraccountid:'.$user, |
|
29 | 29 | 'iat' => time(), |
30 | 30 | 'exp' => strtotime('+1 minutes'), |
31 | 31 | 'tnt' => $baseUrl, |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | foreach ($queryArray as $key => $pieceOfQuery) { |
44 | 44 | $pieceOfQuery = implode(',', $pieceOfQuery); |
45 | - $canonicalQuery .= $key . '=' . $pieceOfQuery . '&'; |
|
45 | + $canonicalQuery .= $key.'='.$pieceOfQuery.'&'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $canonicalQuery = rtrim($canonicalQuery, '&'); |
@@ -91,7 +91,7 @@ |
||
91 | 91 | { |
92 | 92 | // Jira return absolute self links, so its more easy to work with get with absolute urls in such cases |
93 | 93 | if ((0 !== mb_strpos($restUrl, 'http://')) && (0 !== mb_strpos($restUrl, 'https://'))) { |
94 | - return $this->tenant->getBaseUrl() . $restUrl; |
|
94 | + return $this->tenant->getBaseUrl().$restUrl; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | return $restUrl; |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | public static function authTokenMiddleware(string $issuer, string $secret): callable |
15 | 15 | { |
16 | 16 | return Middleware::mapRequest( |
17 | - static function (RequestInterface $request) use ($issuer, $secret) { |
|
17 | + static function(RequestInterface $request) use ($issuer, $secret) { |
|
18 | 18 | return $request->withHeader( |
19 | 19 | 'Authorization', |
20 | - 'JWT ' . JWTGenerator::generate($request, $issuer, $secret) |
|
20 | + 'JWT '.JWTGenerator::generate($request, $issuer, $secret) |
|
21 | 21 | ); |
22 | 22 | } |
23 | 23 | ); |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | string $username |
32 | 32 | ): callable { |
33 | 33 | return Middleware::mapRequest( |
34 | - static function (RequestInterface $request) use ($client, $oauthClientId, $secret, $baseUrl, $username) { |
|
34 | + static function(RequestInterface $request) use ($client, $oauthClientId, $secret, $baseUrl, $username) { |
|
35 | 35 | return $request |
36 | 36 | ->withHeader('Accept', 'application/json') |
37 | 37 | ->withHeader( |
38 | 38 | 'Authorization', |
39 | - 'Bearer ' . self::getAuthToken($client, $oauthClientId, $secret, $baseUrl, $username) |
|
39 | + 'Bearer '.self::getAuthToken($client, $oauthClientId, $secret, $baseUrl, $username) |
|
40 | 40 | ); |
41 | 41 | } |
42 | 42 | ); |