Total Complexity | 3 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class GroupCollection implements \IteratorAggregate |
||
9 | { |
||
10 | private array $groups = []; |
||
11 | |||
12 | public static function createFromArrayResponse(array $response): self |
||
13 | { |
||
14 | $collection = new self(); |
||
15 | |||
16 | foreach ($response as $group) { |
||
17 | $collection->groups[$group->guid] = Group::createFromResponse($group); |
||
18 | } |
||
19 | |||
20 | return $collection; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @return ArrayIterator|\Traversable|Group[] |
||
25 | */ |
||
26 | public function getIterator() |
||
29 | } |
||
30 | } |
||
31 |