Passed
Pull Request — master (#355)
by
unknown
01:41
created
src/Picqer/Financials/Exact/Query/Findable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      *
59 59
      * @return string (guid)
60 60
      */
61
-    public function findId($code, $key='Code')
61
+    public function findId($code, $key = 'Code')
62 62
     {
63 63
         if ($this->isFillable($key)) {
64 64
             $format = ($this->url() == 'crm/Accounts' && $key === 'Code') ? '%18s' : '%s';
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
         $result = $this->connection()->get($this->url(), $request, $headers);
110 110
 
111
-        if (!empty($divisionId)) {
111
+        if ( ! empty($divisionId)) {
112 112
             $this->connection()->setDivision($originalDivision); // Restore division
113 113
         }
114 114
 
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@
 block discarded – undo
241 241
 
242 242
                 $attributes[$attribute] = [];
243 243
                 foreach ($collection as $value) {
244
-                    if(!empty($value->deferred)) {
244
+                    if ( ! empty($value->deferred)) {
245 245
                         $value->attributes = array_merge($value->attributes, $value->deferred);
246 246
                     }
247 247
 
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/PurchaseInvoice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
      * @return mixed
78 78
      */
79 79
     public function getPurchaseInvoiceLines($statement = '') {
80
-        if(array_key_exists('__deferred', $this->attributes['PurchaseInvoiceLines'])) {
80
+        if (array_key_exists('__deferred', $this->attributes['PurchaseInvoiceLines'])) {
81 81
             $this->attributes['PurchaseInvoiceLines'] = (new PurchaseInvoiceLine($this->connection()))->filter("InvoiceID eq guid'{$this->ID}'", "", "", $statement);
82 82
         }
83 83
         return $this->attributes['PurchaseInvoiceLines'];
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/Connection.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     {
249 249
         if ($this->pauseForMinuteLimitEnabled()) {
250 250
             // take 90% of callsLimit so we have some tolerance when multiple process are running
251
-            if($this->callsLeft <= ($this->callsLimit * 0.10)) {
251
+            if ($this->callsLeft <= ($this->callsLimit * 0.10)) {
252 252
                 sleep(60);
253 253
             }
254 254
         }
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
         }
297 297
 
298 298
         // If we have a token, sign the request
299
-        if (!$this->needsAuthentication() && !empty($this->accessToken)) {
299
+        if ( ! $this->needsAuthentication() && ! empty($this->accessToken)) {
300 300
             $headers['Authorization'] = 'Bearer ' . $this->accessToken;
301 301
         }
302 302
 
303 303
         // Create param string
304
-        if (!empty($params)) {
304
+        if ( ! empty($params)) {
305 305
             $endpoint .= '?' . http_build_query($params);
306 306
         }
307 307
 
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
      */
630 630
     private function getTimestampFromExpiresIn($expiresIn)
631 631
     {
632
-        if (!ctype_digit($expiresIn)) {
632
+        if ( ! ctype_digit($expiresIn)) {
633 633
             throw new \InvalidArgumentException('Function requires a numeric expires value');
634 634
         }
635 635
 
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
      */
728 728
     private function parseExceptionForErrorMessages(Exception $e)
729 729
     {
730
-        if (! $e instanceof BadResponseException) {
730
+        if ( ! $e instanceof BadResponseException) {
731 731
             throw new ApiException($e->getMessage());
732 732
         }
733 733
 
@@ -736,13 +736,13 @@  discard block
 block discarded – undo
736 736
         $responseBody = $response->getBody()->getContents();
737 737
         $decodedResponseBody = json_decode($responseBody, true);
738 738
 
739
-        if (! is_null($decodedResponseBody) && isset($decodedResponseBody['error']['message']['value'])) {
739
+        if ( ! is_null($decodedResponseBody) && isset($decodedResponseBody['error']['message']['value'])) {
740 740
             $errorMessage = $decodedResponseBody['error']['message']['value'];
741 741
         } else {
742 742
             $errorMessage = $responseBody;
743 743
         }
744 744
 
745
-        throw new ApiException('Error ' . $response->getStatusCode() .': ' . $errorMessage);
745
+        throw new ApiException('Error ' . $response->getStatusCode() . ': ' . $errorMessage);
746 746
     }
747 747
 
748 748
     /**
Please login to merge, or discard this patch.