New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added method setBoundaries #4
Conversation
@@ -102,7 +102,8 @@ class SqlFormatter | |||
); | |||
|
|||
// Punctuation that can be used as a boundary between other tokens | |||
protected static $boundaries = array(',', ';',':', ')', '(', '.', '=', '<', '>', '+', '-', '*', '/', '!', '^', '%', '|', '&', '#'); | |||
const DEFAULT_BOUNDARIES = array(',', ';',':', ')', '(', '.', '=', '<', '>', '+', '-', '*', '/', '!', '^', '%', '|', '&', '#'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v PHP 5.6
nemoze byt public const
.
public static function setBoundaries(array $boundaries) | ||
{ | ||
self::$boundaries = $boundaries; | ||
self::$regex_boundaries = '('.implode('|',array_map(array(__CLASS__, 'quote_regex'),self::$boundaries)).')'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pri zmene tychto vyhradenych znakov, je potrebne upravit aj regexp.
@@ -122,7 +123,7 @@ public function testSynapseTempTables() { | |||
$sqlWithComment = "-- This is comment\n" . $sql; | |||
$expected = <<<SQL | |||
SELECT | |||
* INTO # temp_table | |||
* INTO #temp_table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prehliadol som, ze mi to tu pridava medzeru, co je nespravne.
@ondrajodas mozes prosim pozriet este tento fix, nevsimol som si to |
@Webrouse jj jdu na to |
Jira: https://keboola.atlassian.net/browse/COM-570