Completed
Push — master ( 6584d5...14a2bb )
by Andrii
08:21
created

Charge::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

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 13
ccs 0
cts 13
cp 0
rs 9.4285
cc 1
eloc 11
nc 1
nop 5
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\charge;
12
13
use hiqdev\php\billing\action\ActionInterface;
14
use hiqdev\php\billing\target\TargetInterface;
15
use hiqdev\php\billing\type\TypeInterface;
16
use hiqdev\php\units\QuantityInterface;
17
use Money\Money;
18
19
/**
20
 * Charge.
21
 *
22
 * [[Action]] is charged with a number of [[Charge]]s.
23
 *
24
 * @author Andrii Vasyliev <[email protected]>
25
 */
26
class Charge
27
{
28
    /**
29
     * @var int
30
     */
31
    public $id;
32
33
    /**
34
     * @var ActionInterface
35
     */
36
    public $action;
37
38
    /**
39
     * @var TargetInterface
40
     */
41
    public $target;
42
43
    /**
44
     * @var TypeInterface
45
     */
46
    public $type;
47
48
    /**
49
     * @var QuantityInterface
50
     */
51
    public $usage;
52
53
    /**
54
     * @var Money
55
     */
56
    public $sum;
57
58 1
    public function __construct(
59
        ActionInterface     $action,
60
        TargetInterface     $target,
61
        TypeInterface       $type,
62
        QuantityInterface   $usage,
63
        Money               $sum
64
    ) {
65 1
        $this->action   = $action;
66 1
        $this->target   = $target;
67 1
        $this->type     = $type;
68 1
        $this->usage    = $usage;
69 1
        $this->sum      = $sum;
70 1
    }
71
72 1
    public function getAction()
73
    {
74 1
        return $this->action;
75
    }
76
77 1
    public function getTarget()
78
    {
79 1
        return $this->target;
80
    }
81
82 1
    public function getType()
83
    {
84 1
        return $this->type;
85
    }
86
87 1
    public function getUsage()
88
    {
89 1
        return $this->usage;
90
    }
91
92 1
    public function getSum()
93
    {
94 1
        return $this->sum;
95
    }
96
}
97