public static function isValidURL(string $url, bool $query = false): bool
    {
        if (
            true === $query &&
            !filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED) === false
        ) {
            return true;
        }

        if (!filter_var($url, FILTER_VALIDATE_URL) === false) {
            return true;
        }

        return false;
    }