| @@ 413-427 (lines=15) @@ | ||
| 410 | * |
|
| 411 | * @return int|null the appropriate flag for the symbol type |
|
| 412 | */ |
|
| 413 | public static function isSymbol($str) |
|
| 414 | { |
|
| 415 | if (strlen($str) === 0) { |
|
| 416 | return null; |
|
| 417 | } |
|
| 418 | if ($str[0] === '@') { |
|
| 419 | return Token::FLAG_SYMBOL_VARIABLE; |
|
| 420 | } elseif ($str[0] === self::getIdentifierQuote()) { |
|
| 421 | return Token::FLAG_SYMBOL_BACKTICK; |
|
| 422 | } elseif ($str[0] === ':' || $str[0] === '?') { |
|
| 423 | return Token::FLAG_SYMBOL_PARAMETER; |
|
| 424 | } |
|
| 425 | ||
| 426 | return null; |
|
| 427 | } |
|
| 428 | ||
| 429 | // ------------------------------------------------------------------------- |
|
| 430 | // String. |
|
| @@ 439-453 (lines=15) @@ | ||
| 436 | * |
|
| 437 | * @return int|null the appropriate flag for the string type |
|
| 438 | */ |
|
| 439 | public static function isString($str) |
|
| 440 | { |
|
| 441 | if (strlen($str) === 0) { |
|
| 442 | return null; |
|
| 443 | } |
|
| 444 | if ($str[0] === '\'') { |
|
| 445 | return Token::FLAG_STRING_SINGLE_QUOTES; |
|
| 446 | } elseif (self::hasMode(self::SQL_MODE_ANSI_QUOTES) && $str[0] === '"') { |
|
| 447 | return null; |
|
| 448 | } elseif ($str[0] === '"') { |
|
| 449 | return Token::FLAG_STRING_DOUBLE_QUOTES; |
|
| 450 | } |
|
| 451 | ||
| 452 | return null; |
|
| 453 | } |
|
| 454 | ||
| 455 | // ------------------------------------------------------------------------- |
|
| 456 | // Delimiter. |
|