diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2015-07-08 01:57:40 +0300 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2015-07-08 01:57:40 +0300 |
commit | 0bff48ae488e651c37d84ba0a9aa8ff57ae8a43e (patch) | |
tree | a83de6667ab20278aa5f874fda9a102987606c43 /src | |
parent | 244180ae825b0d5fb1561efad6738e92d5eee07c (diff) | |
download | sql-parser-0bff48ae488e651c37d84ba0a9aa8ff57ae8a43e.zip sql-parser-0bff48ae488e651c37d84ba0a9aa8ff57ae8a43e.tar.gz sql-parser-0bff48ae488e651c37d84ba0a9aa8ff57ae8a43e.tar.bz2 |
Improved documentation.
Diffstat (limited to 'src')
25 files changed, 60 insertions, 59 deletions
diff --git a/src/Fragments/AlterFragment.php b/src/Fragments/AlterFragment.php index fbcce4c..3b71773 100644 --- a/src/Fragments/AlterFragment.php +++ b/src/Fragments/AlterFragment.php @@ -108,7 +108,7 @@ class AlterFragment extends Fragment /** * Counts brackets. - * @var int + * @var int $brackets */ $brackets = 0; @@ -130,7 +130,7 @@ class AlterFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/ArrayFragment.php b/src/Fragments/ArrayFragment.php index 8c91fc2..5927751 100644 --- a/src/Fragments/ArrayFragment.php +++ b/src/Fragments/ArrayFragment.php @@ -81,7 +81,7 @@ class ArrayFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/CallKeyword.php b/src/Fragments/CallKeyword.php index e56940b..aae2b52 100644 --- a/src/Fragments/CallKeyword.php +++ b/src/Fragments/CallKeyword.php @@ -82,7 +82,7 @@ class CallKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/DataTypeFragment.php b/src/Fragments/DataTypeFragment.php index e40b3f4..d17cfa9 100644 --- a/src/Fragments/DataTypeFragment.php +++ b/src/Fragments/DataTypeFragment.php @@ -110,7 +110,7 @@ class DataTypeFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/FieldDefFragment.php b/src/Fragments/FieldDefFragment.php index a4c21d7..947a881 100644 --- a/src/Fragments/FieldDefFragment.php +++ b/src/Fragments/FieldDefFragment.php @@ -154,7 +154,7 @@ class FieldDefFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/FieldFragment.php b/src/Fragments/FieldFragment.php index c33a7d7..a0bfc6d 100644 --- a/src/Fragments/FieldFragment.php +++ b/src/Fragments/FieldFragment.php @@ -120,25 +120,25 @@ class FieldFragment extends Fragment /** * Whether current tokens make an expression or a table reference. - * @var bool + * @var bool $isExpr */ $isExpr = false; /** * Whether a period was previously found. - * @var bool + * @var bool $period */ $period = false; /** * Whether an alias is expected. Is 2 if `AS` keyword was found. - * @var int + * @var int $alias */ $alias = 0; /** * Counts brackets. - * @var int + * @var int $brackets */ $brackets = 0; @@ -148,14 +148,14 @@ class FieldFragment extends Fragment * string, if function was previously found; * true, if open bracket was previously found; * null, in any other case. - * @var string|bool + * @var string|bool $prev */ $prev = null; for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/FieldListFragment.php b/src/Fragments/FieldListFragment.php index cc070c1..cdf6428 100644 --- a/src/Fragments/FieldListFragment.php +++ b/src/Fragments/FieldListFragment.php @@ -41,7 +41,7 @@ class FieldListFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/IntoKeyword.php b/src/Fragments/IntoKeyword.php index cf65da6..9117dce 100644 --- a/src/Fragments/IntoKeyword.php +++ b/src/Fragments/IntoKeyword.php @@ -76,7 +76,7 @@ class IntoKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/JoinKeyword.php b/src/Fragments/JoinKeyword.php index f8e1a57..4d47ec4 100644 --- a/src/Fragments/JoinKeyword.php +++ b/src/Fragments/JoinKeyword.php @@ -68,7 +68,7 @@ class JoinKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/KeyFragment.php b/src/Fragments/KeyFragment.php index c27d745..7c165fe 100644 --- a/src/Fragments/KeyFragment.php +++ b/src/Fragments/KeyFragment.php @@ -114,7 +114,7 @@ class KeyFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/LimitKeyword.php b/src/Fragments/LimitKeyword.php index c646eba..06db20b 100644 --- a/src/Fragments/LimitKeyword.php +++ b/src/Fragments/LimitKeyword.php @@ -67,7 +67,7 @@ class LimitKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/OptionsFragment.php b/src/Fragments/OptionsFragment.php index 1288508..5384a77 100644 --- a/src/Fragments/OptionsFragment.php +++ b/src/Fragments/OptionsFragment.php @@ -56,13 +56,13 @@ class OptionsFragment extends Fragment /** * The ID that will be assigned to duplicate options. - * @var int + * @var int $lastAssignedId */ $lastAssignedId = count($options) + 1; /** * The option that was processed last time. - * @var array + * @var array $lastOption */ $lastOption = null; $lastOptionId = 0; @@ -72,7 +72,7 @@ class OptionsFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/OrderKeyword.php b/src/Fragments/OrderKeyword.php index 7a76084..710aff8 100644 --- a/src/Fragments/OrderKeyword.php +++ b/src/Fragments/OrderKeyword.php @@ -69,7 +69,7 @@ class OrderKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/ParamDefFragment.php b/src/Fragments/ParamDefFragment.php index 23b84e3..d766cff 100644 --- a/src/Fragments/ParamDefFragment.php +++ b/src/Fragments/ParamDefFragment.php @@ -82,7 +82,7 @@ class ParamDefFragment extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/ReferencesKeyword.php b/src/Fragments/ReferencesKeyword.php index ea10d20..95e3d92 100644 --- a/src/Fragments/ReferencesKeyword.php +++ b/src/Fragments/ReferencesKeyword.php @@ -101,7 +101,7 @@ class ReferencesKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/RenameKeyword.php b/src/Fragments/RenameKeyword.php index de81848..10cf7fd 100644 --- a/src/Fragments/RenameKeyword.php +++ b/src/Fragments/RenameKeyword.php @@ -73,7 +73,7 @@ class RenameKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/SetKeyword.php b/src/Fragments/SetKeyword.php index 713a179..d9e0871 100644 --- a/src/Fragments/SetKeyword.php +++ b/src/Fragments/SetKeyword.php @@ -69,7 +69,7 @@ class SetKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/ValuesKeyword.php b/src/Fragments/ValuesKeyword.php index c867551..bed0c5f 100644 --- a/src/Fragments/ValuesKeyword.php +++ b/src/Fragments/ValuesKeyword.php @@ -67,7 +67,7 @@ class ValuesKeyword extends Fragment for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Fragments/WhereKeyword.php b/src/Fragments/WhereKeyword.php index 5a38b78..90fc0fa 100644 --- a/src/Fragments/WhereKeyword.php +++ b/src/Fragments/WhereKeyword.php @@ -87,7 +87,7 @@ class WhereKeyword extends Fragment /** * Counts brackets. - * @var int + * @var int $brackets */ $brackets = 0; @@ -104,7 +104,7 @@ class WhereKeyword extends Fragment /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Lexer.php b/src/Lexer.php index 40ed75d..17b3f35 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -287,19 +287,19 @@ class Lexer /** * Value to be returned. - * @var Token + * @var Token $ret */ $ret = null; /** * The value of `$this->last` where `$token` ends in `$this->str`. - * @var int + * @var int $iEnd */ $iEnd = $this->last; /** * Whether last parsed character is a whitespace. - * @var bool + * @var bool $lastSpace */ $lastSpace = false; @@ -343,13 +343,13 @@ class Lexer /** * Value to be returned. - * @var Token|bool + * @var Token $ret */ $ret = null; /** * The value of `$this->last` where `$token` ends in `$this->str`. - * @var int + * @var int $iEnd */ $iEnd = $this->last; diff --git a/src/Parser.php b/src/Parser.php index a15a308..124848f 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -278,25 +278,25 @@ class Parser /** * Last parsed statement. - * @var Statement + * @var Statement $lastStatement */ $lastStatement = null; /** * Whether a union is parsed or not. - * @var bool + * @var bool $inUnion */ $inUnion = true; /** * The index of the last token from the last statement. - * @var int + * @var int $prevLastIdx */ $prevLastIdx = -1; /** * The list of tokens. - * @var TokensList + * @var TokensList $list */ $list = &$this->list; @@ -304,7 +304,7 @@ class Parser /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; @@ -334,13 +334,13 @@ class Parser /** * The name of the class that is used for parsing. - * @var string + * @var string $class */ $class = static::$STATEMENT_PARSERS[$token->value]; /** * Processed statement. - * @var Statement + * @var Statement $stmt */ $stmt = new $class($this, $this->list); diff --git a/src/Statement.php b/src/Statement.php index 61e26fb..16b1819 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -82,7 +82,7 @@ abstract class Statement { /** * Query to be returned. - * @var string + * @var string $query */ $query = ''; @@ -90,14 +90,14 @@ abstract class Statement /** * The name of the clause. - * @var string + * @var string $name */ $name = $clause[0]; /** * The type of the clause. * @see self::$CLAUSES - * @var int + * @var int $type */ $type = $clause[1]; @@ -108,14 +108,14 @@ abstract class Statement /** * The builder (parser) of this clause. - * @var string + * @var string $class */ $class = Parser::$KEYWORD_PARSERS[$name]['class']; /** * The name of the field that is used as source for the builder. * Same field is used to store the result of parsing. - * @var string + * @var string $field */ $field = Parser::$KEYWORD_PARSERS[$name]['field']; @@ -155,14 +155,14 @@ abstract class Statement * Whether options were parsed or not. * For statements that do not have any options this is set to `true` by * default. - * @var bool + * @var bool $parsedOptions */ $parsedOptions = isset(static::$OPTIONS) ? false : true; for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; @@ -185,19 +185,19 @@ abstract class Statement /** * The name of the class that is used for parsing. - * @var string + * @var string $class */ $class = null; /** * The name of the field where the result of the parsing is stored. - * @var string + * @var string $field */ $field = null; /** * Parser's options. - * @var array + * @var array $options */ $options = array(); diff --git a/src/Statements/AlterStatement.php b/src/Statements/AlterStatement.php index 92f3744..24de371 100644 --- a/src/Statements/AlterStatement.php +++ b/src/Statements/AlterStatement.php @@ -96,7 +96,7 @@ class AlterStatement extends Statement for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. - * @var Token + * @var Token $token */ $token = $list->tokens[$list->idx]; diff --git a/src/Statements/NotImplementedStatement.php b/src/Statements/NotImplementedStatement.php index f5f8b8f..0a1dc33 100644 --- a/src/Statements/NotImplementedStatement.php +++ b/src/Statements/NotImplementedStatement.php @@ -29,6 +29,7 @@ class NotImplementedStatement extends Statement /** * The part of the statement that can't be parsed. + * * @var Token[] */ public $unknown = array(); diff --git a/src/Utils/Query.php b/src/Utils/Query.php index ef5b07c..ba0d384 100644 --- a/src/Utils/Query.php +++ b/src/Utils/Query.php @@ -510,44 +510,44 @@ class Query /** * The index of the current clause. - * @var int + * @var int $currIdx */ $currIdx = 0; /** * The count of brackets. * We keep track of them so we won't insert the clause in a subquery. - * @var int + * @var int $brackets */ $brackets = 0; /** * The string to be returned. - * @var string + * @var string $ret */ $ret = ''; /** * The clauses of this type of statement and their index. - * @var array + * @var array $clauses */ $clauses = array_flip(array_keys($statement::$CLAUSES)); /** * Lexer used for lexing the clause. - * @var Lexer + * @var Lexer $lexer */ $lexer = new Lexer($clause); /** * The type of this clause. - * @var string + * @var string $clauseType */ $clauseType = $lexer->list->getNextOfType(Token::TYPE_KEYWORD)->value; /** * The index of this clause. - * @var int + * @var int $clauseIdx */ $clauseIdx = $clauses[$clauseType]; @@ -669,7 +669,7 @@ class Query /** * Value to be returned. - * @var string + * @var string $ret */ $ret = ''; |