Passed
Push — master ( a738d8...ad4d7e )
by
unknown
03:09
created

Money   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 5
Bugs 3 Features 0
Metric Value
wmc 5
c 5
b 3
f 0
lcom 0
cbo 0
dl 0
loc 61
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAmount() 0 4 1
A setAmount() 0 6 1
A getCurrency() 0 4 1
A setCurrency() 0 6 1
1
<?php
2
3
namespace CultureKings\Afterpay\Model;
4
5
/**
6
 * Class Money
7
 *
8
 * @package CultureKings\Afterpay\Model
9
 */
10
class Money
11
{
12
    /**
13
     * @var double
14
     */
15
    protected $amount;
16
    /**
17
     * @var string
18
     */
19
    protected $currency;
20
21
    /**
22
     * Money constructor.
23
     * @param float  $amount
24
     * @param string $currency
25
     */
26
    public function __construct($amount = null, $currency = null)
27
    {
28
        $this->setAmount($amount);
29
        $this->setCurrency($currency);
30
    }
31
32
    /**
33
     * @return float
34
     */
35
    public function getAmount()
36
    {
37
        return $this->amount;
38
    }
39
40
    /**
41
     * @param double $amount
42
     * @return $this
43
     */
44
    public function setAmount($amount)
45
    {
46
        $this->amount = $amount;
47
48
        return $this;
49
    }
50
51
52
    /**
53
     * @return string
54
     */
55
    public function getCurrency()
56
    {
57
        return $this->currency;
58
    }
59
60
    /**
61
     * @param string $currency
62
     * @return $this
63
     */
64
    public function setCurrency($currency)
65
    {
66
        $this->currency = $currency;
67
68
        return $this;
69
    }
70
}
71