@@ -67,8 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | try { |
69 | 69 | $response = $this->getAdapter()->call($method, $path, $query, $postFields, array(), $headers); |
70 | - } |
|
71 | - catch (BadResponseException $e) { |
|
70 | + } catch (BadResponseException $e) { |
|
72 | 71 | $statusCode = $e->getStatusCode(); |
73 | 72 | switch ($statusCode) { |
74 | 73 | case 404: |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | public function register(SilexApplication $app) |
26 | 26 | { |
27 | - $app['phraseanet-sdk.config'] = $app->share(function () use ($app) { |
|
27 | + $app['phraseanet-sdk.config'] = $app->share(function() use ($app) { |
|
28 | 28 | return array_replace( |
29 | 29 | array( |
30 | 30 | 'client-id' => null, |
@@ -35,26 +35,26 @@ discard block |
||
35 | 35 | ); |
36 | 36 | }); |
37 | 37 | |
38 | - $app['phraseanet-sdk.guzzle.plugins'] = $app->share(function ($app) { |
|
38 | + $app['phraseanet-sdk.guzzle.plugins'] = $app->share(function($app) { |
|
39 | 39 | return []; |
40 | 40 | }); |
41 | 41 | |
42 | - $app['phraseanet-sdk.guzzle-adapter'] = $app->share(function (SilexApplication $app) { |
|
42 | + $app['phraseanet-sdk.guzzle-adapter'] = $app->share(function(SilexApplication $app) { |
|
43 | 43 | return GuzzleAdapter::create( |
44 | 44 | $app['phraseanet-sdk.config']['url'], |
45 | 45 | $app['phraseanet-sdk.guzzle.plugins'] |
46 | 46 | ); |
47 | 47 | }); |
48 | 48 | |
49 | - $app['phraseanet-sdk.guzzle-connected-adapter'] = $app->protect(function ($token) use ($app) { |
|
49 | + $app['phraseanet-sdk.guzzle-connected-adapter'] = $app->protect(function($token) use ($app) { |
|
50 | 50 | return new ConnectedGuzzleAdapter($token, $app['phraseanet-sdk.guzzle-adapter']); |
51 | 51 | }); |
52 | 52 | |
53 | - $app['phraseanet-sdk.guzzle-api-adapter'] = $app->protect(function ($token) use ($app) { |
|
53 | + $app['phraseanet-sdk.guzzle-api-adapter'] = $app->protect(function($token) use ($app) { |
|
54 | 54 | return new APIGuzzleAdapter($app['phraseanet-sdk.guzzle-connected-adapter']($token)); |
55 | 55 | }); |
56 | 56 | |
57 | - $app['phraseanet-sdk'] = $app->share(function (SilexApplication $app) { |
|
57 | + $app['phraseanet-sdk'] = $app->share(function(SilexApplication $app) { |
|
58 | 58 | return Application::create($app['phraseanet-sdk.config'], $app['phraseanet-sdk.guzzle-adapter']); |
59 | 59 | }); |
60 | 60 | } |