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

Charge   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 71
ccs 0
cts 33
cp 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getAction() 0 4 1
A getTarget() 0 4 1
A getType() 0 4 1
A getUsage() 0 4 1
A getSum() 0 4 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 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