Sorry for not catching this earlier. The code generation already catches nulls, so this just needs to be: `$return = is_float($value) ? (float) $value : (int) $value;`