Completed
Push — master ( 7f8a91...102b97 )
by Joachim
11:48
created
src/Entity/Price.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -166,26 +166,26 @@  discard block
 block discarded – undo
166 166
     {
167 167
         $unitPrice = $this->getUnitPrice();
168 168
 
169
-        if(!$unitPrice) {
169
+        if (!$unitPrice) {
170 170
             return null;
171 171
         }
172 172
 
173 173
         $multiplier = BigDecimal::of('100')->exactlyDividedBy(BigDecimal::of('100')->plus($vat));
174 174
 
175
-        return $unitPrice->multiply((string)$multiplier);
175
+        return $unitPrice->multiply((string) $multiplier);
176 176
     }
177 177
 
178 178
     public function getSpecialOfferPriceExclVat(float $vat) : ?Money
179 179
     {
180 180
         $specialOfferPrice = $this->getSpecialOfferPrice();
181 181
 
182
-        if(!$specialOfferPrice) {
182
+        if (!$specialOfferPrice) {
183 183
             return null;
184 184
         }
185 185
 
186 186
         $multiplier = BigDecimal::of('100')->exactlyDividedBy(BigDecimal::of('100')->plus($vat));
187 187
 
188
-        return $specialOfferPrice->multiply((string)$multiplier);
188
+        return $specialOfferPrice->multiply((string) $multiplier);
189 189
     }
190 190
 
191 191
     /**
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public function getId(): int
195 195
     {
196
-        return (int)$this->id;
196
+        return (int) $this->id;
197 197
     }
198 198
 
199 199
     /**
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
      */
284 284
     public function getSpecialOfferPrice() : ?Money
285 285
     {
286
-        if(!$this->currency) {
286
+        if (!$this->currency) {
287 287
             return null;
288 288
         }
289
-        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int)$this->specialOfferPrice);
289
+        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int) $this->specialOfferPrice);
290 290
     }
291 291
 
292 292
     /**
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     public function setSpecialOfferPrice(Money $specialOfferPrice) : PriceInterface
297 297
     {
298 298
         // @todo change type from int to string
299
-        $this->specialOfferPrice = (int)$specialOfferPrice->getAmount();
299
+        $this->specialOfferPrice = (int) $specialOfferPrice->getAmount();
300 300
 
301 301
         return $this;
302 302
     }
@@ -306,10 +306,10 @@  discard block
 block discarded – undo
306 306
      */
307 307
     public function getUnitPrice() : ?Money
308 308
     {
309
-        if(!$this->currency) {
309
+        if (!$this->currency) {
310 310
             return null;
311 311
         }
312
-        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int)$this->unitPrice);
312
+        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int) $this->unitPrice);
313 313
     }
314 314
 
315 315
     /**
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     public function setUnitPrice(Money $unitPrice) : PriceInterface
320 320
     {
321 321
         // @todo change type from int to string
322
-        $this->unitPrice = (int)$unitPrice->getAmount();
322
+        $this->unitPrice = (int) $unitPrice->getAmount();
323 323
 
324 324
         return $this;
325 325
     }
Please login to merge, or discard this patch.
src/Entity/Order.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
         $multiplier = BigDecimal::of('100')->exactlyDividedBy(BigDecimal::of('100')->plus($this->vatPct));
383 383
 
384
-        return $totalPrice->multiply((string)$multiplier);
384
+        return $totalPrice->multiply((string) $multiplier);
385 385
     }
386 386
 
387 387
     public function totalPriceWithoutFees() : ?Money
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
             $orderLine = $orderLine->getExternalId();
428 428
         }
429 429
 
430
-        return $this->orderLines->exists(function ($key, OrderLineInterface $element) use ($orderLine) {
430
+        return $this->orderLines->exists(function($key, OrderLineInterface $element) use ($orderLine) {
431 431
             return $element->getExternalId() === $orderLine;
432 432
         });
433 433
     }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      */
457 457
     public function getTotalPrice() : ?Money
458 458
     {
459
-        return $this->createMoney((int)$this->totalPrice);
459
+        return $this->createMoney((int) $this->totalPrice);
460 460
     }
461 461
 
462 462
     /**
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
      */
476 476
     public function getSalesDiscount() : ?Money
477 477
     {
478
-        return $this->createMoney((int)$this->salesDiscount);
478
+        return $this->createMoney((int) $this->salesDiscount);
479 479
     }
480 480
 
481 481
     /**
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
      */
495 495
     public function getGiftCertificateAmount() : ?Money
496 496
     {
497
-        return $this->createMoney((int)$this->giftCertificateAmount);
497
+        return $this->createMoney((int) $this->giftCertificateAmount);
498 498
     }
499 499
 
500 500
     /**
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
      */
514 514
     public function getShippingMethodFee() : ?Money
515 515
     {
516
-        return $this->createMoney((int)$this->shippingMethodFee);
516
+        return $this->createMoney((int) $this->shippingMethodFee);
517 517
     }
518 518
 
519 519
     /**
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
      */
533 533
     public function getPaymentMethodFee() : ?Money
534 534
     {
535
-        return $this->createMoney((int)$this->paymentMethodFee);
535
+        return $this->createMoney((int) $this->paymentMethodFee);
536 536
     }
537 537
 
538 538
     /**
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
      */
552 552
     public function getId(): int
553 553
     {
554
-        return (int)$this->id;
554
+        return (int) $this->id;
555 555
     }
556 556
 
557 557
     /**
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
      */
570 570
     public function getExternalId(): int
571 571
     {
572
-        return (int)$this->externalId;
572
+        return (int) $this->externalId;
573 573
     }
574 574
 
575 575
     /**
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
      */
1149 1149
     private function createMoney(int $amount = 0) : ?Money
1150 1150
     {
1151
-        if(!$this->currency) {
1151
+        if (!$this->currency) {
1152 1152
             return null;
1153 1153
         }
1154 1154
 
Please login to merge, or discard this patch.
src/Entity/OrderLine.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
         $multiplier = BigDecimal::of('100')->plus($this->vatPct)->exactlyDividedBy('100');
155 155
 
156
-        return $unitPrice->multiply((string)$multiplier);
156
+        return $unitPrice->multiply((string) $multiplier);
157 157
     }
158 158
 
159 159
     public function getUnitPriceExclVat() : ?Money
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
         $multiplier = BigDecimal::of('100')->plus($this->vatPct)->exactlyDividedBy('100');
172 172
 
173
-        return $totalPrice->multiply((string)$multiplier);
173
+        return $totalPrice->multiply((string) $multiplier);
174 174
     }
175 175
 
176 176
     public function getTotalPriceExclVat() : ?Money
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function getId(): int
185 185
     {
186
-        return (int)$this->id;
186
+        return (int) $this->id;
187 187
     }
188 188
 
189 189
     /**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     public function getExternalId(): int
203 203
     {
204
-        return (int)$this->externalId;
204
+        return (int) $this->externalId;
205 205
     }
206 206
 
207 207
     /**
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
      */
292 292
     public function getTotalPrice()
293 293
     {
294
-        return DandomainFoundation\createMoney($this->getCurrencyCode(), (int)$this->totalPrice);
294
+        return DandomainFoundation\createMoney($this->getCurrencyCode(), (int) $this->totalPrice);
295 295
     }
296 296
 
297 297
     /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     public function getUnitPrice()
312 312
     {
313
-        return DandomainFoundation\createMoney($this->getCurrencyCode(), (int)$this->unitPrice);
313
+        return DandomainFoundation\createMoney($this->getCurrencyCode(), (int) $this->unitPrice);
314 314
     }
315 315
 
316 316
     /**
Please login to merge, or discard this patch.