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

HasQuantity::getPrepaid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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