summaryrefslogtreecommitdiffstats
path: root/src/Context.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-06-16 01:10:37 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-06-16 01:10:37 +0300
commit655e07391436f1445461db6a02be4efbc34fa35d (patch)
tree06cfe3239cc8cbb34948cc72a824d82e1eaa1cea /src/Context.php
parent846d7c3417d4b1c748193163f038a2619ce62c93 (diff)
downloadsql-parser-655e07391436f1445461db6a02be4efbc34fa35d.zip
sql-parser-655e07391436f1445461db6a02be4efbc34fa35d.tar.gz
sql-parser-655e07391436f1445461db6a02be4efbc34fa35d.tar.bz2
Improved documentation and coding style.
Diffstat (limited to 'src/Context.php')
-rw-r--r--src/Context.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Context.php b/src/Context.php
index 2b43e56..4c73af2 100644
--- a/src/Context.php
+++ b/src/Context.php
@@ -372,12 +372,14 @@ abstract class Context
$len = strlen($str);
if ($str[0] === '#') {
return Token::FLAG_COMMENT_BASH;
- } elseif (($len > 1) && ((($str[0] === '/') && ($str[1] === '*')) ||
- (($str[0] === '*') && ($str[1] === '/')))) {
+ } elseif (($len > 1) && ((($str[0] === '/') && ($str[1] === '*'))
+ || (($str[0] === '*') && ($str[1] === '/')))
+ ) {
return Token::FLAG_COMMENT_C;
- } elseif (($len > 2) && ($str[0] === '-') &&
- ($str[1] === '-') && ($str[2] !== "\n") &&
- (static::isWhitespace($str[2]))) {
+ } elseif (($len > 2) && ($str[0] === '-')
+ && ($str[1] === '-') && ($str[2] !== "\n")
+ && (static::isWhitespace($str[2]))
+ ) {
return Token::FLAG_COMMENT_SQL;
}
return null;
@@ -413,8 +415,8 @@ abstract class Context
*/
public static function isNumber($ch)
{
- return (($ch >= '0') && ($ch <= '9')) || ($ch === '.') ||
- ($ch === '-') || ($ch === '+') || ($ch === 'e') || ($ch === 'E');
+ return (($ch >= '0') && ($ch <= '9')) || ($ch === '.')
+ || ($ch === '-') || ($ch === '+') || ($ch === 'e') || ($ch === 'E');
}
// -------------------------------------------------------------------------