Passed
Push — master ( a4d359...48ca8a )
by Dane
02:05
created

SubscriptionsResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 10
rs 10
1
<?php
2
3
namespace AcquiaCloudApi\Response;
4
5
/**
6
 * @template TValue
7
 * @template-extends \ArrayObject<int,TValue>
8
 */
9
class SubscriptionsResponse extends \ArrayObject
10
{
11
12
    /**
13
     * @param array<object> $subscriptions
14
     */
15
    public function __construct($subscriptions)
16
    {
17
        parent::__construct(
18
            array_map(
19
                function ($subscription) {
20
                    return new SubscriptionResponse($subscription);
21
                },
22
                $subscriptions
23
            ),
24
            self::ARRAY_AS_PROPS
25
        );
26
    }
27
}
28