Passed
Push — feature/refactor-subscription-... ( 326c18 )
by Darío
03:04
created

Money   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 2
Metric Value
wmc 6
eloc 14
c 2
b 1
f 2
dl 0
loc 41
ccs 17
cts 17
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCurrencyCode() 0 3 1
A getValue() 0 3 1
A setValue() 0 5 1
A setCurrencyCode() 0 5 1
A toArray() 0 5 1
1
<?php
2
3
namespace PaymentGateway\PayPalSdk\Subscriptions;
4
5
class Money
6
{
7
    protected string $currencyCode;
8
9
    protected string $value;
10
11 13
    public function __construct(string $currencyCode, string $value)
12
    {
13 13
        $this->currencyCode = $currencyCode;
14 13
        $this->value = $value;
15 13
    }
16
17 1
    public function getCurrencyCode(): string
18
    {
19 1
        return $this->currencyCode;
20
    }
21
22 1
    public function setCurrencyCode(string $currencyCode): self
23
    {
24 1
        $this->currencyCode = $currencyCode;
25
26 1
        return $this;
27
    }
28
29 4
    public function getValue(): string
30
    {
31 4
        return $this->value;
32
    }
33
34 1
    public function setValue(string $value): self
35
    {
36 1
        $this->value = $value;
37
38 1
        return $this;
39
    }
40
41 10
    public function toArray(): array
42
    {
43
        return [
44 10
            'currency_code' => $this->currencyCode,
45 10
            'value' => $this->value
46
        ];
47
    }
48
}
49