@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $app = new Application(); |
| 35 | 35 | $app['debug'] = true; |
| 36 | 36 | $app->register(new Silex\Provider\TwigServiceProvider(), array( |
| 37 | - 'twig.path' => __DIR__ . '/views', |
|
| 37 | + 'twig.path' => __DIR__.'/views', |
|
| 38 | 38 | )); |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * You can validate your descriptor |
| 46 | 46 | * @see https://atlassian-connect-validator.herokuapp.com/validate |
| 47 | 47 | */ |
| 48 | -$app->get('/descriptor.json', function (Request $request) { |
|
| 48 | +$app->get('/descriptor.json', function(Request $request) { |
|
| 49 | 49 | |
| 50 | 50 | /* |
| 51 | 51 | * We have to construct the correct URL in order to confluence be able to contact us |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | 'authentication' => [ |
| 64 | 64 | 'type' => 'jwt' |
| 65 | 65 | ], |
| 66 | - 'baseUrl' => $scheme . '://' . $host, |
|
| 66 | + 'baseUrl' => $scheme.'://'.$host, |
|
| 67 | 67 | 'scopes' => [ |
| 68 | 68 | 'read' |
| 69 | 69 | ], |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * They will give us a payload containing the sharedSecret we'll need to use to sign our request. |
| 81 | 81 | * For the demo we just save the content to a file. |
| 82 | 82 | */ |
| 83 | -$app->post('/installed', function (Request $request) { |
|
| 83 | +$app->post('/installed', function(Request $request) { |
|
| 84 | 84 | |
| 85 | 85 | $payload = $request->getContent(); |
| 86 | 86 | file_put_contents('payload.json', $payload); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * Even if the documentation tell's you the only needed webhook is the installed one, |
| 97 | 97 | * they won't let you enable the add-on unless you define the route to you 'enabled' webhook. |
| 98 | 98 | */ |
| 99 | -$app->post('/enabled', function () { |
|
| 99 | +$app->post('/enabled', function() { |
|
| 100 | 100 | /** |
| 101 | 101 | * Be sure to send a 200 OK response, or the app will tell you that your plugin can't be enabled. |
| 102 | 102 | */ |
@@ -104,20 +104,20 @@ discard block |
||
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | 106 | //Catch all route to run our test code |
| 107 | -$app->match('/api/{url}', function ($url) use ($client) { |
|
| 107 | +$app->match('/api/{url}', function($url) use ($client) { |
|
| 108 | 108 | $response = $client->sendRawApiRequest('GET', $url); |
| 109 | 109 | $content = $response->getBody()->getContents(); |
| 110 | 110 | return new Response($content, $response->getStatusCode()); |
| 111 | 111 | |
| 112 | 112 | })->assert('url', '.+'); |
| 113 | 113 | |
| 114 | -$app->match('/image/{url}', function ($url) use ($client) { |
|
| 114 | +$app->match('/image/{url}', function($url) use ($client) { |
|
| 115 | 115 | $response = $client->downloadAttachment($url); |
| 116 | 116 | $content = $response->getBody()->getContents(); |
| 117 | 117 | return new Response($content, $response->getStatusCode(), $response->getHeaders()); |
| 118 | 118 | })->assert('url', '.+'); |
| 119 | 119 | |
| 120 | -$app->match('/', function (Application $app) { |
|
| 120 | +$app->match('/', function(Application $app) { |
|
| 121 | 121 | return $app['twig']->render("index.html.twig"); |
| 122 | 122 | }); |
| 123 | 123 | |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | private function getExceptionMessageForResponse($response = null) |
| 126 | 126 | { |
| 127 | 127 | |
| 128 | - if(null === $response){ |
|
| 128 | + if (null === $response) { |
|
| 129 | 129 | return null; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | $payload = new Payload('payload.json'); |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -$authenticationMethod = new QueryParamAuthentication('eu.adlogix.confluence-client', $payload->getSharedSecret()); |
|
| 18 | +$authenticationMethod = new QueryParamAuthentication('eu.adlogix.confluence-client', $payload->getSharedSecret()); |
|
| 19 | 19 | /** @var \Adlogix\ConfluenceClient\Client $client */ |
| 20 | 20 | $client = ClientBuilder::create($payload->getBaseUrl(), $authenticationMethod) |
| 21 | 21 | ->setDebug(true) |