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