public static function sizeFile($object, $value): bool
    {
        // allow empty field, validate on filter 'required'
        if ($object === null) {
            return true;
        }

        if (!Any::isArray($value)) {
            $value = [0, $value];
        }

        // input file is not object?
        if ($object === null || !Any::isObj($object)) {
            return false;
        }

        // get file upload size in bytes
        $realSize = $object->getClientSize();
        if ($realSize === null) {
            return false;
        }

        return $realSize > $value[0] && $realSize <= $value[1];
    }
public static function sizeFile($object, $value): bool
    {
        // allow empty field, validate on filter 'required'
        if ($object === null) {
            return true;
        }

        if (!Any::isArray($value)) {
            $value = [0, $value];
        }

        // input file is not object?
        if ($object === null || !Any::isObj($object)) {
            return false;
        }

        // get file upload size in bytes
        $realSize = $object->getClientSize();
        if ($realSize === null) {
            return false;
        }

        return $realSize > $value[0] && $realSize <= $value[1];
    }
public static function sizeFile ( $ object , $ value ) : bool { // allow empty field, validate on filter 'required' if ( $ object === null ) { return true ; } if ( ! Any :: isArray ( $ value ) ) { $ value = [ 0 , $ value ] ; } // input file is not object? if ( $ object === null || ! Any :: isObj ( $ object ) ) { return false ; } // get file upload size in bytes $ realSize = $ object -> getClientSize ( ) ; if ( $ realSize === null ) { return false ; } return $ realSize > $ value [ 0 ] && $ realSize <= $ value [ 1 ] ; }
Check file size. If is null - will return true
@param object $object
@param $value
@return bool
Check file size . If is null - will return true