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