public static function filter($value = null, bool $allowNull = false)
    {
        if (self::valueIsNullAndValid($allowNull, $value)) {
            return null;
        }

        self::validateString($value);

        return self::filterUrl($value);
    }
public static function filter($value = null, bool $allowNull = false)
    {
        if (self::valueIsNullAndValid($allowNull, $value)) {
            return null;
        }

        self::validateString($value);

        return self::filterUrl($value);
    }
public static function filter ( $ value = null , bool $ allowNull = false ) { if ( self :: valueIsNullAndValid ( $ allowNull , $ value ) ) { return null ; } self :: validateString ( $ value ) ; return self :: filterUrl ( $ value ) ; }
Filter an url

Filters value as URL (according to » http://www.faqs.org/rfcs/rfc2396)

The return value is the url, as expected by the \TraderInteractive\Filterer class.
By default, nulls are not allowed.

@param mixed $value The value to filter.
@param bool $allowNull True to allow nulls through, and false (default) if nulls should not be allowed.

@return string|null The passed in $value.

@throws FilterException if the value did not pass validation.
Filter an url