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

BillingCycleSet::addBillingCycle()   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
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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