Passed
Push — 2.x ( 829ffb...9244df )
by Darío
48s queued 14s
created

Money   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 10
c 1
b 0
f 1
dl 0
loc 27
ccs 9
cts 11
cp 0.8182
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrencyCode() 0 3 1
A __construct() 0 4 1
A toArray() 0 5 1
A getValue() 0 3 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 5
    public function __construct(string $currencyCode, string $value)
12
    {
13 5
        $this->currencyCode = $currencyCode;
14 5
        $this->value = $value;
15 5
    }
16
17
    public function getCurrencyCode(): string
18
    {
19
        return $this->currencyCode;
20
    }
21
22 3
    public function getValue(): string
23
    {
24 3
        return $this->value;
25
    }
26
27 5
    public function toArray(): array
28
    {
29
        return [
30 5
            'currency_code' => $this->currencyCode,
31 5
            'value' => $this->value
32
        ];
33
    }
34
}
35