Completed
Push — master ( a7e110...90712e )
by Andrii
02:38
created

Charge::getTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
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 Money\Money;
14
use hiqdev\php\units\QuantityInterface;
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 2
    public function __construct(
56
        ActionInterface     $action,
57
        TargetInterface     $target,
58
        TypeInterface       $type,
59
        QuantityInterface   $usage,
60
        Money               $sum
61
    ) {
62 2
        $this->action   = $action;
63 2
        $this->target   = $target;
64 2
        $this->type     = $type;
65 2
        $this->usage    = $usage;
66 2
        $this->sum      = $sum;
67 2
    }
68
69 1
    public function getAction()
70
    {
71 1
        return $this->action;
72
    }
73
74 1
    public function getTarget()
75
    {
76 1
        return $this->target;
77
    }
78
79 1
    public function getType()
80
    {
81 1
        return $this->type;
82
    }
83
84 1
    public function getUsage()
85
    {
86 1
        return $this->usage;
87
    }
88
89
    public function getSum()
90
    {
91
        return $this->sum;
92
    }
93
}
94