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

BillingCycleSet::getBillingCycles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace PaymentGateway\PayPalSdk\Subscriptions\BillingCycles;
4
5
class BillingCycleSet
6
{
7
    /**
8
     * @var AbstractBillingCycle[]
9
     */
10
    protected array $billingCycles = [];
11
12 4
    public function addBillingCycle(AbstractBillingCycle $billingCycle)
13
    {
14 4
        $this->billingCycles[] = $billingCycle;
15 4
    }
16
17
    /**
18
     * @return AbstractBillingCycle[]
19
     */
20 3
    public function getBillingCycles(): array
21
    {
22 3
        return $this->billingCycles;
23
    }
24
25 4
    public function toArray(): array
26
    {
27 4
        $array = [];
28
29 4
        foreach ($this->billingCycles as $billingCycle) {
30 4
            $array[] = $billingCycle->toArray();
31
        }
32
33 4
        return $array;
34
    }
35
}
36