Skip to content
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

Merged
merged 1 commit into from Dec 11, 2020

Conversation

michaljurecko
Copy link
Collaborator

@michaljurecko michaljurecko commented Dec 11, 2020

@@ -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(',', ';',':', ')', '(', '.', '=', '<', '>', '+', '-', '*', '/', '!', '^', '%', '|', '&', '#');
Copy link
Collaborator Author

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)).')';
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

@michaljurecko michaljurecko marked this pull request as ready for review December 11, 2020 13:48
@michaljurecko
Copy link
Collaborator Author

@ondrajodas mozes prosim pozriet este tento fix, nevsimol som si to

@ondrajodas
Copy link

@Webrouse jj jdu na to

@michaljurecko michaljurecko merged commit 03c7561 into master Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants