Passed
Pull Request — master (#102)
by
unknown
02:24
created
src/price/RatePrice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         $sum = $quantity->multiply((string) -$this->rate);
50 50
         $currency = strtoupper($sum->getUnit()->getName());
51 51
 
52
-        return Money::{$currency}((int)floor($sum->getQuantity()));
52
+        return Money::{$currency}((int) floor($sum->getQuantity()));
53 53
     }
54 54
 
55 55
     public function calculatePrice(QuantityInterface $quantity): ?Money
Please login to merge, or discard this patch.
src/price/ProgressivePriceThreshold.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@
 block discarded – undo
45 45
     public static function createFromObjects(Money $price, Quantity $quantity): self
46 46
     {
47 47
         return new self(
48
-            (string)((int)$price->getAmount() / 100), // TODO: Might be not 100 for some currencies
48
+            (string) ((int) $price->getAmount() / 100), // TODO: Might be not 100 for some currencies
49 49
             $price->getCurrency()->getCode(),
50
-            (string)$quantity->getQuantity(),
50
+            (string) $quantity->getQuantity(),
51 51
             $quantity->getUnit()->getName()
52 52
         );
53 53
     }
Please login to merge, or discard this patch.
src/price/ProgressivePriceCalculationTrace.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
             $this->billedUsage->getQuantity(),
30 30
             $this->billedUsage->getUnit()->getName(),
31 31
             $this->threshold->getRawPrice(),
32
-            number_format($this->charged->getAmount()/100, 2),
32
+            number_format($this->charged->getAmount() / 100, 2),
33 33
         );
34 34
     }
35 35
 
Please login to merge, or discard this patch.
src/price/ProgressivePriceThresholdList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public static function fromScalarsArray(array $thresholds): self
41 41
     {
42
-        return new self(array_map(function ($threshold) {
42
+        return new self(array_map(function($threshold) {
43 43
             return ProgressivePriceThreshold::createFromScalar(
44 44
                 $threshold['price'],
45 45
                 $threshold['currency'],
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     private function prepareThresholds(): void
84 84
     {
85
-        usort($this->thresholds, function (ProgressivePriceThreshold $a, ProgressivePriceThreshold $b) {
85
+        usort($this->thresholds, function(ProgressivePriceThreshold $a, ProgressivePriceThreshold $b) {
86 86
             if ($b->quantity()->convert($a->quantity()->getUnit())->equals($a->quantity())) {
87 87
                 return $b->price()->getAmount() <=> $a->price()->getAmount();
88 88
             }
Please login to merge, or discard this patch.
src/charge/modifiers/addons/MonthPeriod.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     {
24 24
         $diff = $time->diff($since);
25 25
 
26
-        return ($diff->m + $diff->y*12) / $this->value;
26
+        return ($diff->m + $diff->y * 12) / $this->value;
27 27
     }
28 28
 
29 29
     public function addTo(DateTimeImmutable $since): DateTimeImmutable
Please login to merge, or discard this patch.
src/charge/modifiers/addons/Discount.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
             throw new FormulaSemanticsError('multiplier for discount must be numeric');
110 110
         }
111 111
 
112
-        return new static($this->isAbsolute() ? $this->value->multiply((string)$multiplier) : $this->getValue()*$multiplier);
112
+        return new static($this->isAbsolute() ? $this->value->multiply((string) $multiplier) : $this->getValue() * $multiplier);
113 113
     }
114 114
 
115 115
     public function add($addend)
Please login to merge, or discard this patch.
src/charge/modifiers/addons/Maximum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
     {
27 27
         return $this->value instanceof Money
28 28
             ? $this->value
29
-            : $charge->getSum()->multiply(sprintf('%.14F', $this->value*0.01));
29
+            : $charge->getSum()->multiply(sprintf('%.14F', $this->value * 0.01));
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/charge/modifiers/addons/Step.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
             return $this->multiply($num)->add($start);
28 28
         }
29 29
 
30
-        $start = $start->getValue()/100.0;
31
-        $factor = $this->getValue()/100.0;
30
+        $start = $start->getValue() / 100.0;
31
+        $factor = $this->getValue() / 100.0;
32 32
 
33
-        $value = 1 - (1 - $start)*pow(1 - $factor, $num);
33
+        $value = 1 - (1 - $start) * pow(1 - $factor, $num);
34 34
 
35
-        return new Discount($value*100);
35
+        return new Discount($value * 100);
36 36
     }
37 37
 
38 38
     public function inverted(): self
Please login to merge, or discard this patch.
src/formula/FormulaEngine.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
128 128
     public function normalize(string $formula): ?string
129 129
     {
130 130
         $lines = explode(self::FORMULAS_SEPARATOR, $formula);
131
-        $normalized = array_map(function ($value) {
131
+        $normalized = array_map(function($value) {
132 132
             $value = trim($value);
133 133
             if ('' === $value) {
134 134
                 return null;
Please login to merge, or discard this patch.