Passed
Push — master ( 373e60...256112 )
by Dmitry
25:12 queued 10:02
created

HasQuantity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
c 0
b 0
f 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUnit() 0 3 1
A getPrepaid() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace hiqdev\php\billing\price;
4
5
use hiqdev\php\units\QuantityInterface;
6
use hiqdev\php\units\UnitInterface;
7
8
trait HasQuantity
9
{
10
    /**
11
     * @var QuantityInterface prepaid quantity also implies Unit
12
     * XXX cannot be null cause Unit is required
13
     */
14
    protected QuantityInterface $prepaid;
15
16
    public function getPrepaid(): QuantityInterface
17
    {
18
        return $this->prepaid;
19
    }
20
21
    public function getUnit(): UnitInterface
22
    {
23
        return $this->prepaid->getUnit();
24
    }
25
}
26