Completed
Push — master ( 41f74f...866870 )
by Andrii
03:39
created

Charge::getTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing;
12
13
use hiqdev\php\units\QuantityInterface;
14
use Money\Money;
15
16
/**
17
 * Charge.
18
 *
19
 * [[Action]] is charged with a number of [[Charge]]s.
20
 *
21
 * @author Andrii Vasyliev <[email protected]>
22
 */
23
class Charge
24
{
25
    /**
26
     * @var int
27
     */
28
    public $id;
29
30
    /**
31
     * @var ActionInterface
32
     */
33
    public $action;
34
35
    /**
36
     * @var TargetInterface
37
     */
38
    public $target;
39
40
    /**
41
     * @var TypeInterface
42
     */
43
    public $type;
44
45
    /**
46
     * @var QuantityInterface
47
     */
48
    public $usage;
49
50
    /**
51
     * @var Money
52
     */
53
    public $sum;
54
55
    public function __construct(
56
        ActionInterface     $action,
57
        TargetInterface     $target,
58
        TypeInterface       $type,
59
        QuantityInterface   $usage,
60
        Money               $sum
61
    ) {
62
        $this->action   = $action;
63
        $this->target   = $target;
64
        $this->type     = $type;
65
        $this->usage    = $usage;
66
        $this->sum      = $sum;
67
    }
68
69
    public function getAction()
70
    {
71
        return $this->action;
72
    }
73
74
    public function getTarget()
75
    {
76
        return $this->target;
77
    }
78
79
    public function getType()
80
    {
81
        return $this->type;
82
    }
83
84
    public function getUsage()
85
    {
86
        return $this->usage;
87
    }
88
89
    public function getSum()
90
    {
91
        return $this->sum;
92
    }
93
}
94