Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CollectionType extends AbstractType |
||
9 | { |
||
10 | private iterable $resource; |
||
11 | |||
12 | 2 | public function __construct(iterable $resource, string $transformer, array $meta = [], ?string $key = null) |
|
13 | { |
||
14 | 2 | $this->resource = $resource; |
|
15 | 2 | $this->transformer = $transformer; |
|
16 | 2 | $this->key = $key; |
|
17 | 2 | $this->meta = $meta; |
|
18 | 2 | } |
|
19 | |||
20 | 1 | public function asResource(): ResourceAbstract |
|
21 | { |
||
22 | 1 | $item = new Collection($this->resource, $this->transformer, $this->key); |
|
23 | 1 | $item->setMeta($this->meta); |
|
24 | |||
25 | 1 | return $item; |
|
26 | } |
||
27 | |||
28 | 1 | public function getResource(): iterable |
|
31 | } |
||
32 | } |
||
33 |