Completed
Pull Request — master (#82)
by
unknown
06:37
created
src/PhraseanetSDK/Http/GuzzleAdapter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function getBaseUrl()
83 83
     {
84 84
         // return $this->guzzleClient->getBaseUrl();  // removed
85
-        return $this->baseUri ;
85
+        return $this->baseUri;
86 86
     }
87 87
 
88 88
     /**
@@ -156,29 +156,29 @@  discard block
 block discarded – undo
156 156
             ];
157 157
 
158 158
             // files -- receiving files has no usage found in the code, so format of $files is unknown, so... not implmented
159
-            if(count($files) > 0) {
160
-                throw new \GuzzleHttp\Exception\InvalidArgumentException('request with "files" is not implemented' );
159
+            if (count($files) > 0) {
160
+                throw new \GuzzleHttp\Exception\InvalidArgumentException('request with "files" is not implemented');
161 161
             }
162 162
 
163 163
             // postFields
164
-            if(count($postFields) > 0) {
165
-                if($method !== 'POST') {
164
+            if (count($postFields) > 0) {
165
+                if ($method !== 'POST') {
166 166
                     throw new InvalidArgumentException('postFields are only allowed with "POST" method');
167 167
                 }
168
-                if(count($files) > 0) {
168
+                if (count($files) > 0) {
169 169
                     // this will not happen while "files" is not implemented
170
-                    throw new \GuzzleHttp\Exception\InvalidArgumentException('request can\'t contain both postFields and files' );
170
+                    throw new \GuzzleHttp\Exception\InvalidArgumentException('request can\'t contain both postFields and files');
171 171
                 }
172 172
                 $options[RequestOptions::FORM_PARAMS] = $postFields;
173 173
             }
174 174
 
175 175
             // headers
176 176
             $h = array_merge($acceptHeader, $headers);
177
-            if($this->userAgent !== '' && !array_key_exists('User-Agent', $h)) {
177
+            if ($this->userAgent !== '' && !array_key_exists('User-Agent', $h)) {
178 178
                 // use the defaut user-agent if none is provided in headers
179 179
                 $h['User-Agent'] = sprintf('%s version %s', ApplicationInterface::USER_AGENT, ApplicationInterface::VERSION);
180 180
             }
181
-            if(count($h) > 0) {
181
+            if (count($h) > 0) {
182 182
                 $options[RequestOptions::HEADERS] = $h;
183 183
             }
184 184
 
Please login to merge, or discard this patch.
src/PhraseanetSDK/PhraseanetSDKServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.