summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradityagoyal <ang.adityagoyal@yahoo.com>2013-07-06 01:47:48 +0530
committeradityagoyal <ang.adityagoyal@yahoo.com>2013-07-06 01:47:48 +0530
commitb0e95c9fc8e1aa6caeafe3f520cf8e1571c6a15e (patch)
tree38b0a3630cdbe02d52fef9afb0200c876df23368
parentba8b1a3f8d00d067614e9e237f680ede9a7e7393 (diff)
downloadsql-formatter-b0e95c9fc8e1aa6caeafe3f520cf8e1571c6a15e.zip
sql-formatter-b0e95c9fc8e1aa6caeafe3f520cf8e1571c6a15e.tar.gz
sql-formatter-b0e95c9fc8e1aa6caeafe3f520cf8e1571c6a15e.tar.bz2
removed remove_blank_line method as suggested and calling format method to format after removing comments.
removed remove_blank_line method as suggested and calling format method to format after removing comments.
-rw-r--r--lib/SqlFormatter.php12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/SqlFormatter.php b/lib/SqlFormatter.php
index 55e5207..dc06e51 100644
--- a/lib/SqlFormatter.php
+++ b/lib/SqlFormatter.php
@@ -748,7 +748,7 @@ class SqlFormatter
$result .= $token[self::TOKEN_VALUE];
}
- $result = self::remove_blank_lines($result);
+ $result = self::format( $result,false);
return $result;
}
@@ -1051,14 +1051,4 @@ class SqlFormatter
else return php_sapi_name() === 'cli';
}
- /**
- * Removes blank line between and before sql statements.
- *@param String $sql from which blank lines need to be removed
- *
- * @return String sql without blank lines
- */
- private static function remove_blank_lines($sql)
- {
- return preg_replace('/^\n+|^[\t\s]*\n+/m','',$sql);
- }
}