@@ -281,7 +281,7 @@ |
||
281 | 281 | return $this->adjustments; |
282 | 282 | } |
283 | 283 | |
284 | - return $this->adjustments->filter(function (AdjustmentInterface $adjustment) use ($type) { |
|
284 | + return $this->adjustments->filter(function(AdjustmentInterface $adjustment) use ($type) { |
|
285 | 285 | return $type === $adjustment->getType(); |
286 | 286 | }); |
287 | 287 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function isInRange() |
48 | 48 | { |
49 | - if($this->start > new \DateTime() || ($this->end !== null && $this->end < new \DateTime())){ |
|
49 | + if ($this->start > new \DateTime() || ($this->end !== null && $this->end < new \DateTime())) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | return true; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | function it_assumes_quantity_is_1_if_not_provided_in_context(PriceableInterface $priceable) |
35 | 35 | { |
36 | 36 | $configuration = array( |
37 | - array('min' => 0, 'max' => 9, 'price' => 1699), |
|
37 | + array('min' => 0, 'max' => 9, 'price' => 1699), |
|
38 | 38 | array('min' => 10, 'max' => 19, 'price' => 1499), |
39 | 39 | array('min' => 20, 'max' => 29, 'price' => 1299), |
40 | 40 | ); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | function it_returns_the_price_based_on_the_quantity(PriceableInterface $priceable) |
46 | 46 | { |
47 | 47 | $configuration = array( |
48 | - array('min' => 0, 'max' => 9, 'price' => 1699), |
|
48 | + array('min' => 0, 'max' => 9, 'price' => 1699), |
|
49 | 49 | array('min' => 10, 'max' => 19, 'price' => 1499), |
50 | 50 | array('min' => 20, 'max' => 29, 'price' => 1299), |
51 | 51 | ); |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | function it_returns_the_correct_price_for_highest_quantity_range(PriceableInterface $priceable) |
58 | 58 | { |
59 | 59 | $configuration = array( |
60 | - array('min' => 0, 'max' => 9, 'price' => 1699), |
|
61 | - array('min' => 10, 'max' => 19, 'price' => 1499), |
|
62 | - array('min' => 20, 'max' => 29, 'price' => 1299), |
|
60 | + array('min' => 0, 'max' => 9, 'price' => 1699), |
|
61 | + array('min' => 10, 'max' => 19, 'price' => 1499), |
|
62 | + array('min' => 20, 'max' => 29, 'price' => 1299), |
|
63 | 63 | array('min' => 30, 'max' => null, 'price' => 1099), |
64 | 64 | ); |
65 | 65 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $subject->getShippingVolume()->willReturn(100); |
30 | 30 | |
31 | - $this->calculate($subject, array('amount' => 500, 'division' => 2))->shouldReturn(500 * 100/2); |
|
31 | + $this->calculate($subject, array('amount' => 500, 'division' => 2))->shouldReturn(500 * 100 / 2); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | function its_calculated_value_should_be_an_integer(ShippingSubjectInterface $subject) |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | $subject->getShippingWeight()->willReturn(10); |
41 | 41 | |
42 | - $this->calculate($subject, array('fixed' => 200, 'variable' => 500, 'division' => 1))->shouldReturn(200 + 500*10); |
|
42 | + $this->calculate($subject, array('fixed' => 200, 'variable' => 500, 'division' => 1))->shouldReturn(200 + 500 * 10); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | function its_calculated_value_should_be_an_integer(ShippingSubjectInterface $subject) |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function calculate(ShippingSubjectInterface $subject, array $configuration) |
25 | 25 | { |
26 | - return (int)($configuration['amount'] * $subject->getShippingItemCount()); |
|
26 | + return (int) ($configuration['amount'] * $subject->getShippingItemCount()); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function calculate(ShippingSubjectInterface $subject, array $configuration) |
25 | 25 | { |
26 | - return (int)$configuration['amount']; |
|
26 | + return (int) $configuration['amount']; |
|
27 | 27 | } |
28 | 28 | /** |
29 | 29 | * {@inheritdoc} |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $additionalItems = $additionalItemLimit >= $additionalItems ? $additionalItems : $additionalItemLimit; |
35 | 35 | } |
36 | 36 | |
37 | - return (int)($firstItemCost + ($additionalItems * $additionalItemCost)); |
|
37 | + return (int) ($firstItemCost + ($additionalItems * $additionalItemCost)); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -19,24 +19,24 @@ |
||
19 | 19 | /** |
20 | 20 | * Flat rate per shipment calculator. |
21 | 21 | */ |
22 | - const FLAT_RATE = 'flat_rate'; |
|
22 | + const FLAT_RATE = 'flat_rate'; |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Fixed price per item calculator. |
26 | 26 | */ |
27 | - const PER_ITEM_RATE = 'per_item_rate'; |
|
27 | + const PER_ITEM_RATE = 'per_item_rate'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Flexible rate calculator. |
31 | 31 | * Fixed price for first item and constant rate |
32 | 32 | * for each additional item with a limit. |
33 | 33 | */ |
34 | - const FLEXIBLE_RATE = 'flexible_rate'; |
|
34 | + const FLEXIBLE_RATE = 'flexible_rate'; |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Fixed price per weight calculator. |
38 | 38 | */ |
39 | - const WEIGHT_RATE = 'weight_rate'; |
|
39 | + const WEIGHT_RATE = 'weight_rate'; |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Flexible prices for weight ranges. |