@@ -31,7 +31,7 @@ |
||
31 | 31 | /** |
32 | 32 | * @var null - any type can be used as ID or type name |
33 | 33 | */ |
34 | - const null ANY = null; |
|
34 | + const null ANY = null; |
|
35 | 35 | |
36 | 36 | const float NONE = INF; |
37 | 37 |
@@ -12,6 +12,6 @@ |
||
12 | 12 | |
13 | 13 | public static function isDeleted(TargetInterface $target): bool |
14 | 14 | { |
15 | - return self::tryFrom((string)$target->getState()) === self::DELETED; |
|
15 | + return self::tryFrom((string) $target->getState()) === self::DELETED; |
|
16 | 16 | } |
17 | 17 | } |
@@ -105,8 +105,8 @@ |
||
105 | 105 | $price = $threshold->price(); |
106 | 106 | |
107 | 107 | $chargedAmount = $price->money() |
108 | - ->multiply((string)(sprintf('%.14F', $billedUsage->getQuantity()))) |
|
109 | - ->divide((string)(sprintf('%.14F', $price->multiplier()))); |
|
108 | + ->multiply((string)(sprintf('%.14F', $billedUsage->getQuantity()))) |
|
109 | + ->divide((string)(sprintf('%.14F', $price->multiplier()))); |
|
110 | 110 | |
111 | 111 | $this->calculationTraces[] = new ProgressivePriceCalculationTrace( |
112 | 112 | $threshold, $billedUsage, $chargedAmount |
@@ -105,8 +105,8 @@ |
||
105 | 105 | $price = $threshold->price(); |
106 | 106 | |
107 | 107 | $chargedAmount = $price->money() |
108 | - ->multiply((string)(sprintf('%.14F', $billedUsage->getQuantity()))) |
|
109 | - ->divide((string)(sprintf('%.14F', $price->multiplier()))); |
|
108 | + ->multiply((string) (sprintf('%.14F', $billedUsage->getQuantity()))) |
|
109 | + ->divide((string) (sprintf('%.14F', $price->multiplier()))); |
|
110 | 110 | |
111 | 111 | $this->calculationTraces[] = new ProgressivePriceCalculationTrace( |
112 | 112 | $threshold, $billedUsage, $chargedAmount |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | return []; // If there was at least one charge, but it disappeared – modifier does not want this charge to happen. Stop. |
58 | 58 | } |
59 | 59 | |
60 | - $originalChargeExists = array_reduce($leftCharges, static function ($result, Charge $item) use ($charge) { |
|
60 | + $originalChargeExists = array_reduce($leftCharges, static function($result, Charge $item) use ($charge) { |
|
61 | 61 | return $result || $charge === $item; |
62 | 62 | }, false); |
63 | 63 | if ($charge && !$originalChargeExists) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | $lastLeftCharge = end($leftCharges); |
79 | - $rightCharges = array_filter($dirtyRightCharges, function (ChargeInterface $charge) use ($leftTotal, $lastLeftCharge) { |
|
79 | + $rightCharges = array_filter($dirtyRightCharges, function(ChargeInterface $charge) use ($leftTotal, $lastLeftCharge) { |
|
80 | 80 | if ($charge->getParent() === $leftTotal) { |
81 | 81 | $charge->overwriteParent($lastLeftCharge); |
82 | 82 | } |
@@ -154,8 +154,8 @@ |
||
154 | 154 | $chargeQuery = new ChargeDerivativeQuery(); |
155 | 155 | $chargeQuery->changeUsage( |
156 | 156 | $this->getCapInHours() |
157 | - ->multiply($coefficient) |
|
158 | - ->multiply($action->getUsageInterval()->ratioOfMonth()) |
|
157 | + ->multiply($coefficient) |
|
158 | + ->multiply($action->getUsageInterval()->ratioOfMonth()) |
|
159 | 159 | ); |
160 | 160 | $chargeQuery->changeSum($charge->getSum()->multiply($coefficient)); |
161 | 161 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $multiplier = self::calculateMultiplierToInteger($amount); |
54 | 54 | return new self( |
55 | - $parser->parse((string)($amount * $multiplier), $currency), |
|
55 | + $parser->parse((string) ($amount * $multiplier), $currency), |
|
56 | 56 | $multiplier |
57 | 57 | ); |
58 | 58 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | [, $fraction] = explode('.', $amount, 2); |
90 | - return (int)('1' . implode(array_fill(0, strlen($fraction), 0))); |
|
90 | + return (int) ('1' . implode(array_fill(0, strlen($fraction), 0))); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -45,7 +45,7 @@ |
||
45 | 45 | } else { |
46 | 46 | $month = $dto->usageInterval['month']['date']; |
47 | 47 | $start = $dto->usageInterval['start']['date']; |
48 | - $end = $dto->usageInterval['end']['date'];; |
|
48 | + $end = $dto->usageInterval['end']['date']; ; |
|
49 | 49 | $interval = UsageInterval::withinMonth( |
50 | 50 | new DateTimeImmutable($month), |
51 | 51 | new DateTimeImmutable($start), |