Passed
Push — master ( 9dc2b5...745713 )
by Darío
03:33 queued 01:28
created

BillingCycleSet::toArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 4
c 1
b 0
f 1
nc 2
nop 0
dl 0
loc 9
ccs 5
cts 5
cp 1
crap 2
rs 10
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 4
    public function toArray(): array
18
    {
19 4
        $array = [];
20
21 4
        foreach ($this->billingCycles as $billingCycle) {
22 4
            $array[] = $billingCycle->toArray();
23
        }
24
25 4
        return $array;
26
    }
27
}
28