Completed
Push — master ( 778cf4...326520 )
by Joachim
13:13
created
src/Entity/Price.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function getId(): int
143 143
     {
144
-        return (int)$this->id;
144
+        return (int) $this->id;
145 145
     }
146 146
 
147 147
     /**
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
      */
232 232
     public function getSpecialOfferPrice() : ?Money
233 233
     {
234
-        if(!$this->currency) {
234
+        if (!$this->currency) {
235 235
             return null;
236 236
         }
237
-        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int)$this->specialOfferPrice);
237
+        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int) $this->specialOfferPrice);
238 238
     }
239 239
 
240 240
     /**
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
      */
254 254
     public function getUnitPrice() : ?Money
255 255
     {
256
-        if(!$this->currency) {
256
+        if (!$this->currency) {
257 257
             return null;
258 258
         }
259
-        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int)$this->unitPrice);
259
+        return DandomainFoundation\createMoney($this->currency->getIsoCodeAlpha(), (int) $this->unitPrice);
260 260
     }
261 261
 
262 262
     /**
Please login to merge, or discard this patch.
src/Entity/Product.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
     public function __toString()
408 408
     {
409
-        return (string)$this->number;
409
+        return (string) $this->number;
410 410
     }
411 411
 
412 412
     /**
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 
486 486
     public function hasManufacturer(ManufacturerInterface $manufacturer) : bool
487 487
     {
488
-        return $this->manufacturers->exists(function ($key, ManufacturerInterface $element) use ($manufacturer) {
488
+        return $this->manufacturers->exists(function($key, ManufacturerInterface $element) use ($manufacturer) {
489 489
             return $element->getExternalId() === $manufacturer->getExternalId();
490 490
         });
491 491
     }
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
             $variantGroup = $variantGroup->getExternalId();
511 511
         }
512 512
 
513
-        return $this->variantGroups->exists(function ($key, VariantGroupInterface $element) use ($variantGroup) {
513
+        return $this->variantGroups->exists(function($key, VariantGroupInterface $element) use ($variantGroup) {
514 514
             return $element->getExternalId() === $variantGroup;
515 515
         });
516 516
     }
@@ -541,18 +541,18 @@  discard block
 block discarded – undo
541 541
      */
542 542
     public function findPriceByCurrency($currency) : ?PriceInterface
543 543
     {
544
-        if($currency instanceof \Money\Currency) {
544
+        if ($currency instanceof \Money\Currency) {
545 545
             $currency = $currency->getCode();
546 546
         } elseif ($currency instanceof CurrencyInterface) {
547 547
             $currency = $currency->getIsoCodeAlpha();
548 548
         }
549 549
 
550
-        if(!is_string($currency)) {
550
+        if (!is_string($currency)) {
551 551
             throw new \InvalidArgumentException('$currency has to be a string');
552 552
         }
553 553
 
554 554
         foreach ($this->prices as $price) {
555
-            if($price->getCurrency()->getIsoCodeAlpha() === $currency) {
555
+            if ($price->getCurrency()->getIsoCodeAlpha() === $currency) {
556 556
                 return $price;
557 557
             }
558 558
         }
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
             $product = $product->getExternalId();
610 610
         }
611 611
 
612
-        return $this->children->exists(function ($key, ProductInterface $element) use ($product) {
612
+        return $this->children->exists(function($key, ProductInterface $element) use ($product) {
613 613
             return $element->getExternalId() === $product;
614 614
         });
615 615
     }
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
      */
623 623
     public function getId(): int
624 624
     {
625
-        return (int)$this->id;
625
+        return (int) $this->id;
626 626
     }
627 627
 
628 628
     /**
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
      */
641 641
     public function getExternalId(): int
642 642
     {
643
-        return (int)$this->externalId;
643
+        return (int) $this->externalId;
644 644
     }
645 645
 
646 646
     /**
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
      */
1037 1037
     public function getNumber()
1038 1038
     {
1039
-        return (string)$this->number;
1039
+        return (string) $this->number;
1040 1040
     }
1041 1041
 
1042 1042
     /**
Please login to merge, or discard this patch.