Completed
Pull Request — master (#283)
by Rudie
03:05
created
src/Picqer/Financials/Exact/Units.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
  * @property Byte $Main	Indicates the main unit per division. Will be used when creating new item
16 16
  * @property String $TimeUnit If Type = 'T' (time) then this fields indicates the type of time frame. yy = Year, mm = Month, wk = Week, dd = Day, hh = Hour, mi = Minute, ss = Second
17 17
  * @property String $Type Type 'Time' is especially important for contracts.
18
-
19 18
  */
20 19
 class Units extends Model
21 20
 {
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/SalesInvoice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
      * @return mixed
132 132
      */
133 133
     public function getSalesInvoiceLines() {
134
-        if(array_key_exists('__deferred', $this->attributes['SalesInvoiceLines'])) {
134
+        if (array_key_exists('__deferred', $this->attributes['SalesInvoiceLines'])) {
135 135
             $this->attributes['SalesInvoiceLines'] = (new SalesInvoiceLine($this->connection()))->filter("InvoiceID eq guid'{$this->InvoiceID}'");
136 136
         }
137 137
         return $this->attributes['SalesInvoiceLines'];
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/GeneralJournalEntry.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
 
43 43
     public function addItem(array $array)
44 44
     {
45
-        if ( ! isset( $this->attributes['GeneralJournalEntryLines'] ) || $this->attributes['GeneralJournalEntryLines'] == null) {
46
-            $this->attributes['GeneralJournalEntryLines'] = [ ];
45
+        if ( ! isset($this->attributes['GeneralJournalEntryLines']) || $this->attributes['GeneralJournalEntryLines'] == null) {
46
+            $this->attributes['GeneralJournalEntryLines'] = [];
47 47
         }
48 48
         $this->attributes['GeneralJournalEntryLines'][] = $array;
49 49
     }
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/Connection.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
         }
166 166
 
167 167
         // If we have a token, sign the request
168
-        if (!$this->needsAuthentication() && !empty($this->accessToken)) {
168
+        if ( ! $this->needsAuthentication() && ! empty($this->accessToken)) {
169 169
             $headers['Authorization'] = 'Bearer ' . $this->accessToken;
170 170
         }
171 171
 
172 172
         // Create param string
173
-        if (!empty($params)) {
173
+        if ( ! empty($params)) {
174 174
             $endpoint .= '?' . http_build_query($params);
175 175
         }
176 176
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 
459 459
     private function getDateTimeFromExpires($expires)
460 460
     {
461
-        if (!is_numeric($expires)) {
461
+        if ( ! is_numeric($expires)) {
462 462
             throw new \InvalidArgumentException('Function requires a numeric expires value');
463 463
         }
464 464
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
      */
544 544
     private function parseExceptionForErrorMessages(Exception $e)
545 545
     {
546
-        if (! $e instanceof BadResponseException) {
546
+        if ( ! $e instanceof BadResponseException) {
547 547
             throw new ApiException($e->getMessage());
548 548
         }
549 549
 
@@ -552,13 +552,13 @@  discard block
 block discarded – undo
552 552
         $responseBody = $response->getBody()->getContents();
553 553
         $decodedResponseBody = json_decode($responseBody, true);
554 554
 
555
-        if (! is_null($decodedResponseBody) && isset($decodedResponseBody['error']['message']['value'])) {
555
+        if ( ! is_null($decodedResponseBody) && isset($decodedResponseBody['error']['message']['value'])) {
556 556
             $errorMessage = $decodedResponseBody['error']['message']['value'];
557 557
         } else {
558 558
             $errorMessage = $responseBody;
559 559
         }
560 560
 
561
-        throw new ApiException('Error ' . $response->getStatusCode() .': ' . $errorMessage);
561
+        throw new ApiException('Error ' . $response->getStatusCode() . ': ' . $errorMessage);
562 562
     }
563 563
 
564 564
     /**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -358,8 +358,7 @@
 block discarded – undo
358 358
             if (array_key_exists('d', $json)) {
359 359
                 if (array_key_exists('__next', $json['d'])) {
360 360
                     $this->nextUrl = $json['d']['__next'];
361
-                }
362
-                else {
361
+                } else {
363 362
                     $this->nextUrl = null;
364 363
                 }
365 364
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,8 +94,8 @@
 block discarded – undo
94 94
     protected $middleWares = [];
95 95
 
96 96
     /**
97
-    * @var
98
-    */
97
+     * @var
98
+     */
99 99
     public $nextUrl = null;
100 100
 
101 101
     /**
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/PurchaseOrder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,10 +124,10 @@
 block discarded – undo
124 124
      */
125 125
     public function addItem(array $array)
126 126
     {
127
-        if (! isset($this->attributes['PurchaseOrderLines']) || $this->attributes['PurchaseOrderLines'] == null) {
127
+        if ( ! isset($this->attributes['PurchaseOrderLines']) || $this->attributes['PurchaseOrderLines'] == null) {
128 128
             $this->attributes['PurchaseOrderLines'] = [];
129 129
         }
130
-        if (! isset($array['LineNumber'])) {
130
+        if ( ! isset($array['LineNumber'])) {
131 131
             $array['LineNumber'] = count($this->attributes['PurchaseOrderLines']) + 1;
132 132
         }
133 133
         $this->attributes['PurchaseOrderLines'][] = $array;
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/CashEntry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 
53 53
     public function addItem(array $array)
54 54
     {
55
-        if (! isset($this->attributes['CashEntryLines']) || $this->attributes['CashEntryLines'] == null) {
55
+        if ( ! isset($this->attributes['CashEntryLines']) || $this->attributes['CashEntryLines'] == null) {
56 56
             $this->attributes['CashEntryLines'] = [];
57 57
         }
58 58
         $this->attributes['CashEntryLines'][] = $array;
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/SalesOrder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -142,10 +142,10 @@
 block discarded – undo
142 142
      */
143 143
     public function addItem(array $array)
144 144
     {
145
-        if (! isset($this->attributes['SalesOrderLines']) || $this->attributes['SalesOrderLines'] == null) {
145
+        if ( ! isset($this->attributes['SalesOrderLines']) || $this->attributes['SalesOrderLines'] == null) {
146 146
             $this->attributes['SalesOrderLines'] = [];
147 147
         }
148
-        if (! isset($array['LineNumber'])) {
148
+        if ( ! isset($array['LineNumber'])) {
149 149
             $array['LineNumber'] = count($this->attributes['SalesOrderLines']) + 1;
150 150
         }
151 151
         $this->attributes['SalesOrderLines'][] = $array;
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/Model.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,8 +144,7 @@
 block discarded – undo
144 144
 
145 145
                 return true;
146 146
             }
147
-        }
148
-        catch (\Exception $e) {
147
+        } catch (\Exception $e) {
149 148
             // We tried lets leave it as is.
150 149
         }
151 150
 
Please login to merge, or discard this 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/WebhookSubscription.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     use Persistance\Storable;
19 19
 
20 20
     protected $fillable = [
21
-    	'ID',
21
+        'ID',
22 22
         'CallbackURL',
23 23
         'Topic',
24 24
     ];
Please login to merge, or discard this patch.