Completed
Push — develop ( ddd9ad...807fde )
by Jimmy
25s queued 11s
created
src/Api/Client.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             $this->token->refresh($this);
191 191
         }
192 192
 
193
-        return 'Basic ' . base64_encode($this->token->getUsername() . ':' . $this->token->getPassword());
193
+        return 'Basic '.base64_encode($this->token->getUsername().':'.$this->token->getPassword());
194 194
     }
195 195
 
196 196
     /**
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
         // For getAll calls, make sure to add pageSize & page to request
229 229
         if ($this->page) {
230
-            $uri .= (preg_match('/\\?/u', $uri) ? '&' : '?') . 'pageSize=' . $this->page_size . '&page=' . $this->page;
230
+            $uri .= (preg_match('/\\?/u', $uri) ? '&' : '?').'pageSize='.$this->page_size.'&page='.$this->page;
231 231
         }
232 232
 
233 233
         if (strlen($uri) > 2000) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         return array_merge(
288 288
             [
289 289
                 'x-cw-usertype' => 'member',
290
-                'Accept'        => 'application/vnd.connectwise.com+json; version=' . $this->getVersion(),
290
+                'Accept'        => 'application/vnd.connectwise.com+json; version='.$this->getVersion(),
291 291
             ],
292 292
             $authorization_headers,
293 293
             $this->headers
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      */
324 324
     public function getUrl($path = null)
325 325
     {
326
-        return $this->url . '/v4_6_release/apis/3.0/' . ltrim($path, '/');
326
+        return $this->url.'/v4_6_release/apis/3.0/'.ltrim($path, '/');
327 327
     }
328 328
 
329 329
     /**
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
      */
377 377
     protected function isLastPage(ResponseInterface $response)
378 378
     {
379
-        return !(bool)preg_match('/rel="last"$/u', $response->getHeader('Link')[0] ?? null);
379
+        return !(bool) preg_match('/rel="last"$/u', $response->getHeader('Link')[0] ?? null);
380 380
     }
381 381
 
382 382
     /**
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      */
405 405
     protected function processResponse($resource, ResponseInterface $response)
406 406
     {
407
-        $response = (array)json_decode($response->getBody(), true);
407
+        $response = (array) json_decode($response->getBody(), true);
408 408
 
409 409
         // Nothing to map response, so just return it as is
410 410
         if (!$model = $this->resolver->find($resource, $this->getVersion())) {
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
         // Have a collection of records, so cast them all as a collection
420 420
         return new Collection(
421 421
             array_map(
422
-                function ($item) use ($model) {
422
+                function($item) use ($model) {
423 423
                     $item = new $model($item, $this);
424 424
 
425 425
                     return $item;
Please login to merge, or discard this patch.
src/Support/Model.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             }
94 94
         }
95 95
 
96
-        trigger_error('Call to undefined method ' . __CLASS__ . '::' . $method . '()', E_USER_ERROR);
96
+        trigger_error('Call to undefined method '.__CLASS__.'::'.$method.'()', E_USER_ERROR);
97 97
     }
98 98
 
99 99
     /**
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
         }
184 184
 
185 185
         if (class_exists($cast)) {
186
-            return new $cast((array)$value);
186
+            return new $cast((array) $value);
187 187
         }
188 188
 
189 189
         if (strcasecmp('json', $cast) == 0) {
190
-            return json_encode((array)$value);
190
+            return json_encode((array) $value);
191 191
         }
192 192
 
193 193
         if (strcasecmp('collection', $cast) == 0) {
194
-            return new Collection((array)$value);
194
+            return new Collection((array) $value);
195 195
         }
196 196
 
197 197
         if (in_array($cast, ['bool', 'boolean'])) {
@@ -306,8 +306,8 @@  discard block
 block discarded – undo
306 306
 
307 307
         // Allow for making related calls for "extra" properties in the "_info" property.
308 308
         // Cache the results so only 1 call is made
309
-        if (!isset($this->{$attribute}) && isset($this->_info->{$attribute . '_href'})) {
310
-            $this->setAttribute($attribute, $this->client->getAll($this->_info->{$attribute . '_href'}));
309
+        if (!isset($this->{$attribute}) && isset($this->_info->{$attribute.'_href'})) {
310
+            $this->setAttribute($attribute, $this->client->getAll($this->_info->{$attribute.'_href'}));
311 311
         }
312 312
 
313 313
         // Pull the value from the attributes
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         };
317 317
 
318 318
         // Attribute does not exist on the model
319
-        trigger_error('Undefined property:' . __CLASS__ . '::$' . $attribute);
319
+        trigger_error('Undefined property:'.__CLASS__.'::$'.$attribute);
320 320
     }
321 321
 
322 322
     /**
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
      */
355 355
     protected function getterMethodName($attribute)
356 356
     {
357
-        return 'get' . Str::studly($attribute) . 'Attribute';
357
+        return 'get'.Str::studly($attribute).'Attribute';
358 358
     }
359 359
 
360 360
     /**
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
      */
460 460
     protected function setterMethodName($attribute)
461 461
     {
462
-        return 'set' . Str::studly($attribute) . 'Attribute';
462
+        return 'set'.Str::studly($attribute).'Attribute';
463 463
     }
464 464
 
465 465
     /**
Please login to merge, or discard this patch.