diff options
Diffstat (limited to 'src/Context.php')
-rw-r--r-- | src/Context.php | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/src/Context.php b/src/Context.php index 9d6927a..e46a047 100644 --- a/src/Context.php +++ b/src/Context.php @@ -4,6 +4,11 @@ namespace SqlParser; /** * Default MySQL context (based on MySQL 5.7). + * + * @category Contexts + * @package SqlParser + * @author Dan Ungureanu <udan1107@gmail.com> + * @license http://opensource.org/licenses/GPL-2.0 GNU Public License */ abstract class Context { @@ -31,14 +36,14 @@ abstract class Context * * @var string */ - public static $defaultContext = '\\SqlParser\\Contexts\\Context_MySQL570'; + public static $defaultContext = '\\SqlParser\\Contexts\\Context_MySQL50700'; /** * The name of the loaded context. * * @var string */ - public static $loadedContext = '\\SqlParser\\Contexts\\Context_MySQL570'; + public static $loadedContext = '\\SqlParser\\Contexts\\Context_MySQL50700'; // ------------------------------------------------------------------------- // Keywords. @@ -424,10 +429,10 @@ abstract class Context /** * Checks if the given string is a keyword. * - * @param string $str - * @param bool $isReserved + * @param string $str String to be checked. + * @param bool $isReserved Checks if the keyword is reserved. * - * @return bool + * @return int */ public static function isKeyword($str, $isReserved = false) { @@ -451,7 +456,7 @@ abstract class Context /** * Checks if the given string is an operator. * - * @param string $str + * @param string $str String to be checked. * * @return int The appropriate flag for the operator. */ @@ -469,7 +474,7 @@ abstract class Context /** * Checks if the given character is a whitespace. * - * @param string $ch + * @param string $ch String to be checked. * * @return bool */ @@ -484,7 +489,7 @@ abstract class Context /** * Checks if the given string is the beginning of a whitespace. * - * @param string $str + * @param string $str String to be checked. * * @return int The appropriate flag for the comment type. */ @@ -514,7 +519,7 @@ abstract class Context * This actually check only for `TRUE` and `FALSE` because `1` or `0` are * actually numbers and are parsed by specific methods. * - * @param string $ch + * @param string $ch String to be checked. * * @return bool */ @@ -530,7 +535,7 @@ abstract class Context /** * Checks if the given character can be a part of a number. * - * @param string $ch + * @param string $ch String to be checked. * * @return bool */ @@ -547,7 +552,7 @@ abstract class Context * Checks if the given character is the beginning of a symbol. A symbol * can be either a variable or a field name. * - * @param string $ch + * @param string $ch String to be checked. * * @return int The appropriate flag for the symbol type. */ @@ -567,7 +572,7 @@ abstract class Context /** * Checks if the given character is the beginning of a string. * - * @param string $str + * @param string $str String to be checked. * * @return int The appropriate flag for the string type. */ @@ -587,7 +592,7 @@ abstract class Context /** * Checks if the given character can be a separator for two lexems. * - * @param string $ch + * @param string $ch String to be checked. * * @return bool */ @@ -601,9 +606,13 @@ abstract class Context * * Contexts may be used by accessing the context directly. * - * @param string $context + * @param string $context Name of the context or full class name that + * defines the context. + * + * @return void */ - public static function load($context = '') { + public static function load($context = '') + { if (empty($context)) { $context = self::$defaultContext; } @@ -617,5 +626,4 @@ abstract class Context static::$loadedContext = $context; static::$KEYWORDS = $context::$KEYWORDS; } - } |