| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 12 | public function createNodeFromValue(Document $doc, $value): Node |
||
| 13 | { |
||
| 14 | if (null !== $node = $this->createScalarOrNullNodeFromValue($doc, $value)) { |
||
| 15 | return $node; |
||
| 16 | } |
||
| 17 | |||
| 18 | if ($value instanceof \stdClass) { |
||
| 19 | return $this->createObjectNodeFromStdClass($doc, $value); |
||
| 20 | } |
||
| 21 | |||
| 22 | if (\is_array($value)) { |
||
| 23 | return $this->createArrayNodeFromPackedArray($doc, $value); |
||
| 24 | } |
||
| 25 | |||
| 26 | throw new InvalidNodeValueException("Failed to create node from value of type '" . \gettype($value) . "'"); |
||
| 27 | } |
||
| 29 |