Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | class ScalarArrayTypeAdapter extends TypeAdapter |
||
21 | { |
||
22 | /** |
||
23 | * Read the next value, convert it to its type and return it |
||
24 | * |
||
25 | * @param array|null $value |
||
26 | * @param ReaderContext $context |
||
27 | * @return array|null |
||
28 | */ |
||
29 | 2 | public function read($value, ReaderContext $context): ?array |
|
30 | { |
||
31 | 2 | return $value === null ? null : (array)$value; |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * Write the value to the writer for the type |
||
36 | * |
||
37 | * @param array|null $value |
||
38 | * @param WriterContext $context |
||
39 | * @return array|null |
||
40 | */ |
||
41 | 2 | public function write($value, WriterContext $context): ?array |
|
44 | } |
||
45 | } |
||
46 |