@@ -61,7 +61,7 @@ |
||
| 61 | 61 | /** |
| 62 | 62 | * ClientBuilder constructor. |
| 63 | 63 | * |
| 64 | - * @param $baseUri |
|
| 64 | + * @param string $baseUri |
|
| 65 | 65 | * @param AuthenticationInterface $authentication |
| 66 | 66 | */ |
| 67 | 67 | private function __construct($baseUri, AuthenticationInterface $authentication) |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | if (file_exists('payload.json')) { |
| 15 | 15 | $payload = json_decode(file_get_contents('payload.json')); |
| 16 | 16 | $sharedSecret = $payload->sharedSecret; |
| 17 | - $baseUrl = $payload->baseUrl . '/'; |
|
| 17 | + $baseUrl = $payload->baseUrl.'/'; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $options['headers']['content-type'] = 'application/json'; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - return $this->client->request($method, 'rest/api/' . $uri, $options); |
|
| 58 | + return $this->client->request($method, 'rest/api/'.$uri, $options); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | SpaceCollection::class |
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | - if(!$spaceCollection instanceof SpaceCollection){ |
|
| 39 | + if (!$spaceCollection instanceof SpaceCollection) { |
|
| 40 | 40 | return null; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | Space::class |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | - if(!$space instanceof Space){ |
|
| 61 | + if (!$space instanceof Space) { |
|
| 62 | 62 | return null; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | ContentCollection::class |
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | - if(!$contentCollection instanceof ContentCollection){ |
|
| 48 | + if (!$contentCollection instanceof ContentCollection) { |
|
| 49 | 49 | return null; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function findById($id) |
| 63 | 63 | { |
| 64 | - $content = $this->get('content/' . $id); |
|
| 64 | + $content = $this->get('content/'.$id); |
|
| 65 | 65 | $content = $this->deserialize( |
| 66 | 66 | $content, |
| 67 | 67 | Content::class |
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | - if(!$content instanceof Content){ |
|
| 70 | + if (!$content instanceof Content) { |
|
| 71 | 71 | return null; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | if (file_exists('payload.json')) { |
| 20 | 20 | $payload = json_decode(file_get_contents('payload.json')); |
| 21 | 21 | $sharedSecret = $payload->sharedSecret; |
| 22 | - $baseUrl = $payload->baseUrl . '/'; |
|
| 22 | + $baseUrl = $payload->baseUrl.'/'; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $app = new Application(); |
| 39 | 39 | $app['debug'] = true; |
| 40 | 40 | $app->register(new Silex\Provider\TwigServiceProvider(), array( |
| 41 | - 'twig.path' => __DIR__ . '/views', |
|
| 41 | + 'twig.path' => __DIR__.'/views', |
|
| 42 | 42 | )); |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * You can validate your descriptor |
| 50 | 50 | * @see https://atlassian-connect-validator.herokuapp.com/validate |
| 51 | 51 | */ |
| 52 | -$app->get('/descriptor.json', function (Request $request) { |
|
| 52 | +$app->get('/descriptor.json', function(Request $request) { |
|
| 53 | 53 | |
| 54 | 54 | /* |
| 55 | 55 | * We have to construct the correct URL in order to confluence be able to contact us |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'authentication' => [ |
| 68 | 68 | 'type' => 'jwt' |
| 69 | 69 | ], |
| 70 | - 'baseUrl' => $scheme . '://' . $host, |
|
| 70 | + 'baseUrl' => $scheme.'://'.$host, |
|
| 71 | 71 | 'scopes' => [ |
| 72 | 72 | 'read' |
| 73 | 73 | ], |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * They will give us a payload containing the sharedSecret we'll need to use to sign our request. |
| 85 | 85 | * For the demo we just save the content to a file. |
| 86 | 86 | */ |
| 87 | -$app->post('/installed', function (Request $request) { |
|
| 87 | +$app->post('/installed', function(Request $request) { |
|
| 88 | 88 | |
| 89 | 89 | $payload = $request->getContent(); |
| 90 | 90 | file_put_contents('payload.json', $payload); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * Even if the documentation tell's you the only needed webhook is the installed one, |
| 101 | 101 | * they won't let you enable the add-on unless you define the route to you 'enabled' webhook. |
| 102 | 102 | */ |
| 103 | -$app->post('/enabled', function () { |
|
| 103 | +$app->post('/enabled', function() { |
|
| 104 | 104 | /** |
| 105 | 105 | * Be sure to send a 200 OK response, or the app will tell you that your plugin can't be enabled. |
| 106 | 106 | */ |
@@ -108,20 +108,20 @@ discard block |
||
| 108 | 108 | }); |
| 109 | 109 | |
| 110 | 110 | //Catch all route to run our test code |
| 111 | -$app->match('/api/{url}', function ($url) use ($client) { |
|
| 111 | +$app->match('/api/{url}', function($url) use ($client) { |
|
| 112 | 112 | $response = $client->sendRawApiRequest('GET', $url); |
| 113 | 113 | $content = $response->getBody()->getContents(); |
| 114 | 114 | return new Response($content, $response->getStatusCode()); |
| 115 | 115 | |
| 116 | 116 | })->assert('url', '.+'); |
| 117 | 117 | |
| 118 | -$app->match('/image/{url}', function ($url) use ($client) { |
|
| 118 | +$app->match('/image/{url}', function($url) use ($client) { |
|
| 119 | 119 | $response = $client->downloadAttachment($url); |
| 120 | 120 | $content = $response->getBody()->getContents(); |
| 121 | 121 | return new Response($content, $response->getStatusCode(), $response->getHeaders()); |
| 122 | 122 | })->assert('url', '.+'); |
| 123 | 123 | |
| 124 | -$app->match('/', function (Application $app) { |
|
| 124 | +$app->match('/', function(Application $app) { |
|
| 125 | 125 | return $app['twig']->render("index.html.twig"); |
| 126 | 126 | }); |
| 127 | 127 | |