Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
30 | class SinglePrice extends AbstractPrice implements PriceWithQuantityInterface, PriceWithMoneyInterface |
||
31 | { |
||
32 | use HasMoney; |
||
33 | use HasQuantity; |
||
34 | |||
35 | public function __construct( |
||
36 | $id, |
||
37 | TypeInterface $type, |
||
38 | TargetInterface $target, |
||
39 | PlanInterface $plan = null, |
||
40 | QuantityInterface $prepaid, |
||
41 | Money $price |
||
42 | 39 | ) { |
|
43 | parent::__construct($id, $type, $target, $plan); |
||
44 | $this->prepaid = $prepaid; |
||
45 | $this->price = $price; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | 39 | */ |
|
51 | 39 | public function calculateUsage(QuantityInterface $quantity): ?QuantityInterface |
|
52 | 39 | { |
|
53 | 39 | $usage = $quantity->convert($this->prepaid->getUnit())->subtract($this->prepaid); |
|
54 | |||
55 | 3 | if ($usage->isPositive()) { |
|
56 | return $usage; |
||
57 | 3 | } |
|
58 | |||
59 | return Quantity::create($this->prepaid->getUnit()->getName(), 0); |
||
60 | 3 | } |
|
61 | |||
62 | 3 | /** |
|
63 | * {@inheritdoc} |
||
64 | * Same price for any usage. |
||
65 | */ |
||
66 | public function calculatePrice(QuantityInterface $usage): ?Money |
||
69 | } |
||
70 | } |
||
71 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths