Frequency   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 41.18%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 12
c 1
b 0
f 1
dl 0
loc 36
ccs 7
cts 17
cp 0.4118
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setFrequency() 0 3 1
A __construct() 0 4 1
A getFrequency() 0 3 1
A toArray() 0 5 1
A setQuantity() 0 3 1
A getQuantity() 0 3 1
1
<?php
2
3
namespace PaymentGateway\PayPalSdk\Subscriptions;
4
5
class Frequency
6
{
7
    protected string $frequency;
8
    protected int $quantity;
9
10 4
    public function __construct(string $frequency, int $quantity)
11
    {
12 4
        $this->frequency = $frequency;
13 4
        $this->quantity = $quantity;
14 4
    }
15
16
    public function getFrequency(): string
17
    {
18
        return $this->frequency;
19
    }
20
21
    public function setFrequency(string $frequency): void
22
    {
23
        $this->frequency = $frequency;
24
    }
25
26
    public function getQuantity(): int
27
    {
28
        return $this->quantity;
29
    }
30
31
    public function setQuantity(int $quantity): void
32
    {
33
        $this->quantity = $quantity;
34
    }
35
36 4
    public function toArray(): array
37
    {
38
        return [
39 4
            'interval_unit' => $this->frequency,
40 4
            'interval_count' => $this->quantity,
41
        ];
42
    }
43
}
44