src/ResourceValidationsTrait.php
protected function cleanNumberValue($val)
    {
        if ($val !== null) {
            if (is_string($val)) {
                if (trim($val) === '') {
                    $val = null;
                } elseif (is_numeric($val)) {
                    $val = $val*1;
                }
            }
        }
        return $val;
    }
protected function cleanNumberValue($val)
    {
        if ($val !== null) {
            if (is_string($val)) {
                if (trim($val) === '') {
                    $val = null;
                } elseif (is_numeric($val)) {
                    $val = $val*1;
                }
            }
        }
        return $val;
    }
protected function cleanNumberValue ( $ val ) { if ( $ val !== null ) { if ( is_string ( $ val ) ) { if ( trim ( $ val ) === '' ) { $ val = null ; } elseif ( is_numeric ( $ val ) ) { $ val = $ val * 1 ; } } } return $ val ; }
Cleans a value that is expected to be a number

If the value is a string, this coerces it into an int or float by multiplying by 1. Otherwise,
it leaves the value alone.

@param mixed $val The value to clean
@return mixed An int or float value or the original value, if not numeric
Cleans a value that is expected to be a number