| Total Complexity | 4 | 
| Total Lines | 34 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 16 | /** | ||
| 17 | * Class FloatTypeAdapter | ||
| 18 | * | ||
| 19 | * @author Nate Brunette <[email protected]> | ||
| 20 | */ | ||
| 21 | class FloatTypeAdapter extends TypeAdapter | ||
| 22 | { | ||
| 23 | /** | ||
| 24 | * Read the next value, convert it to its type and return it | ||
| 25 | * | ||
| 26 | * @param JsonReadable $reader | ||
| 27 | * @return float|null | ||
| 28 | */ | ||
| 29 | 3 | public function read(JsonReadable $reader): ?float | |
| 37 | } | ||
| 38 | |||
| 39 | /** | ||
| 40 | * Write the value to the writer for the type | ||
| 41 | * | ||
| 42 | * @param JsonWritable $writer | ||
| 43 | * @param float|null $value | ||
| 44 | * @return void | ||
| 45 | */ | ||
| 46 | 3 | public function write(JsonWritable $writer, $value): void | |
| 47 |     { | ||
| 48 | 3 |         if (null === $value) { | |
| 49 | 1 | $writer->writeNull(); | |
| 50 | |||
| 57 |