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

Money::setCurrencyCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
eloc 2
c 1
b 1
f 1
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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