diff options
author | Michal Čihař <michal@cihar.com> | 2016-09-13 14:03:59 +0200 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2016-09-13 14:04:15 +0200 |
commit | 3ece9eedd05b3c106d1327d5771ef55d51621519 (patch) | |
tree | ec7e11b5bb05404f36595d7f6ca258d13fb4f053 | |
parent | 641bad21b8a5ddc130f4d05156d6b4a99422246a (diff) | |
download | sql-parser-3ece9eedd05b3c106d1327d5771ef55d51621519.zip sql-parser-3ece9eedd05b3c106d1327d5771ef55d51621519.tar.gz sql-parser-3ece9eedd05b3c106d1327d5771ef55d51621519.tar.bz2 |
Do not use \e as it's not supported on PHP 5.3
Signed-off-by: Michal Čihař <michal@cihar.com>
-rw-r--r-- | src/Utils/Formatter.php | 18 | ||||
-rw-r--r-- | tests/Utils/FormatterTest.php | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index fd41f9e..56691eb 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -122,49 +122,49 @@ class Formatter 'type' => Token::TYPE_KEYWORD, 'flags' => Token::FLAG_KEYWORD_RESERVED, 'html' => 'class="sql-reserved"', - 'cli' => "\e[35m", + 'cli' => "\x1b[35m", 'function' => 'strtoupper', ), array( 'type' => Token::TYPE_KEYWORD, 'flags' => 0, 'html' => 'class="sql-keyword"', - 'cli' => "\e[95m", + 'cli' => "\x1b[95m", 'function' => 'strtoupper', ), array( 'type' => Token::TYPE_COMMENT, 'flags' => 0, 'html' => 'class="sql-comment"', - 'cli' => "\e[37m", + 'cli' => "\x1b[37m", 'function' => '', ), array( 'type' => Token::TYPE_BOOL, 'flags' => 0, 'html' => 'class="sql-atom"', - 'cli' => "\e[36m", + 'cli' => "\x1b[36m", 'function' => 'strtoupper', ), array( 'type' => Token::TYPE_NUMBER, 'flags' => 0, 'html' => 'class="sql-number"', - 'cli' => "\e[92m", + 'cli' => "\x1b[92m", 'function' => 'strtolower', ), array( 'type' => Token::TYPE_STRING, 'flags' => 0, 'html' => 'class="sql-string"', - 'cli' => "\e[91m", + 'cli' => "\x1b[91m", 'function' => '', ), array( 'type' => Token::TYPE_SYMBOL, 'flags' => 0, 'html' => 'class="sql-variable"', - 'cli' => "\e[36m", + 'cli' => "\x1b[36m", 'function' => '', ), ) @@ -420,7 +420,7 @@ class Formatter } if ($this->options['type'] === 'cli') { - return $ret . "\e[0m"; + return $ret . "\x1b[0m"; } return $ret; @@ -459,7 +459,7 @@ class Formatter } if ($this->options['type'] === 'cli') { - return "\e[39m" . $text; + return "\x1b[39m" . $text; } return $text; } diff --git a/tests/Utils/FormatterTest.php b/tests/Utils/FormatterTest.php index 49fc912..a445476 100644 --- a/tests/Utils/FormatterTest.php +++ b/tests/Utils/FormatterTest.php @@ -75,7 +75,7 @@ class FormatTest extends TestCase ), array( 'SELECT 1', - "\x1b[35mSELECT\n \x1b[92m1\e[0m", + "\x1b[35mSELECT\n \x1b[92m1\x1b[0m", 'cli' ), array( |