| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function denormalizeField( |
||
| 45 | string $path, |
||
| 46 | $object, |
||
| 47 | $value, |
||
| 48 | DenormalizerContextInterface $context, |
||
| 49 | DenormalizerInterface $denormalizer = null |
||
| 50 | ) { |
||
| 51 | if (null === $value) { |
||
| 52 | $this->accessor->setValue($object, $value); |
||
| 53 | |||
| 54 | return; |
||
| 55 | } |
||
| 56 | |||
| 57 | if (is_string($value)) { |
||
| 58 | $repository = $this->repository; |
||
| 59 | |||
| 60 | $this->accessor->setValue($object, $repository($value)); |
||
| 61 | |||
| 62 | return; |
||
| 63 | } |
||
| 64 | |||
| 65 | throw DeserializerRuntimeException::createInvalidDataType($path, gettype($value), 'string'); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |