Total Complexity | 4 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | * @param JsonReadable $reader |
||
22 | * @return float|null |
||
23 | */ |
||
24 | public function read(JsonReadable $reader): ?float |
||
25 | { |
||
26 | if ($reader->peek() === JsonToken::NULL) { |
||
27 | $reader->nextNull(); |
||
28 | return null; |
||
29 | 3 | } |
|
30 | |||
31 | 3 | return $reader->nextDouble(); |
|
32 | 1 | } |
|
33 | 1 | ||
34 | /** |
||
35 | * Write the value to the writer for the type |
||
36 | 2 | * |
|
37 | * @param JsonWritable $writer |
||
38 | * @param float|null $value |
||
39 | * @return void |
||
40 | */ |
||
41 | public function write(JsonWritable $writer, $value): void |
||
50 | } |
||
51 | } |
||
52 |