Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 13 |
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 | throw DeserializerRuntimeException::createInvalidDataType($path, gettype($value), 'string'); |
||
59 | } |
||
60 | |||
61 | $repository = $this->repository; |
||
62 | |||
63 | $this->accessor->setValue($object, $repository($value)); |
||
64 | } |
||
65 | } |
||
66 |