src/ResourceValidationsTrait.php
protected function cleanStringValue($val)
    {
        if ($val !== null) {
            if (is_string($val)) {
                $val = trim($val);
                if ($val === '') {
                    $val = null;
                }
            } elseif (is_int($val)) {
                $val = (string)$val;
            }
        }
        return $val;
    }
protected function cleanStringValue($val)
    {
        if ($val !== null) {
            if (is_string($val)) {
                $val = trim($val);
                if ($val === '') {
                    $val = null;
                }
            } elseif (is_int($val)) {
                $val = (string)$val;
            }
        }
        return $val;
    }
protected function cleanStringValue ( $ val ) { if ( $ val !== null ) { if ( is_string ( $ val ) ) { $ val = trim ( $ val ) ; if ( $ val === '' ) { $ val = null ; } } elseif ( is_int ( $ val ) ) { $ val = ( string ) $ val ; } } return $ val ; }
Cleans a value that is expected to be a string

If the value _is_ a string, this trims it and sets it to null if it's an empty string. If the value
is an integer, it coerces it into a string. Otherwise, it leaves the value alone.

@param mixed $val The value to clean
@return mixed The cleaned string or null or the original value, if not stringish
Cleans a value that is expected to be a string