| Conditions | 4 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 21 | public function setData($data, string $resourceType = null) |
|
| 33 | { |
||
| 34 | 21 | if ($data !== null) { |
|
| 35 | 21 | if (is_a($data, Model::class)) { |
|
| 36 | 3 | $data = $this->generator->resourceIdentifier($data, $resourceType); |
|
| 37 | } |
||
| 38 | 21 | if (is_a($data, Collection::class)) { |
|
| 39 | 15 | $data = $this->generator->riCollection($data, $resourceType); |
|
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | 21 | return parent::setData($data); |
|
| 44 | } |
||
| 46 |