| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2.0932 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 1 | public function hydrate($object, $source, DocumentHydrator $hydrator) |
|
| 24 | { |
||
| 25 | 1 | if (! $object instanceof AbstractDocument) { |
|
| 26 | throw new InvalidDocumentException(sprintf( |
||
| 27 | 'Only top-level of document can contains "jsonapi"-object. Instance of "%s" given.', |
||
| 28 | get_class($object) |
||
| 29 | )); |
||
| 30 | } |
||
| 31 | |||
| 32 | 1 | $jsonApi = $this->createJsonApi($source, $hydrator); |
|
| 33 | |||
| 34 | 1 | $object->setJsonApi($jsonApi); |
|
| 35 | 1 | } |
|
| 36 | |||
| 62 | } |