diff options
159 files changed, 101 insertions, 174 deletions
diff --git a/bin/highlight-query b/bin/highlight-query index a25a3e2..577e4fb 100755 --- a/bin/highlight-query +++ b/bin/highlight-query @@ -1,6 +1,5 @@ #!/usr/bin/env php <?php -declare(strict_types=1); $files = array( __DIR__ . "/../vendor/autoload.php", diff --git a/bin/lint-query b/bin/lint-query index 8d7cd29..67e7114 100755 --- a/bin/lint-query +++ b/bin/lint-query @@ -1,6 +1,5 @@ #!/usr/bin/env php <?php -declare(strict_types=1); $files = array( __DIR__ . "/../vendor/autoload.php", @@ -28,3 +27,4 @@ if (!$found) { $cli = new PhpMyAdmin\SqlParser\Utils\CLI(); exit($cli->runLint()); + diff --git a/bin/tokenize-query b/bin/tokenize-query index 97012c7..f32a4e0 100755 --- a/bin/tokenize-query +++ b/bin/tokenize-query @@ -1,6 +1,5 @@ #!/usr/bin/env php <?php -declare(strict_types=1); $files = array( __DIR__ . "/../vendor/autoload.php", diff --git a/src/Component.php b/src/Component.php index ae05bd8..bb230c2 100644 --- a/src/Component.php +++ b/src/Component.php @@ -1,4 +1,5 @@ <?php + /** * Defines a component that is later extended to parse specialized components or * keywords. @@ -7,7 +8,6 @@ * *Component parsers can be reused in multiple situations and *Keyword parsers * count on the *Component classes to do their job. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Components/AlterOperation.php b/src/Components/AlterOperation.php index d55f155..b3f8e26 100644 --- a/src/Components/AlterOperation.php +++ b/src/Components/AlterOperation.php @@ -1,8 +1,8 @@ <?php + /** * Parses an alter operation. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/Array2d.php b/src/Components/Array2d.php index 29e9dac..984179c 100644 --- a/src/Components/Array2d.php +++ b/src/Components/Array2d.php @@ -1,8 +1,8 @@ <?php + /** * `VALUES` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/ArrayObj.php b/src/Components/ArrayObj.php index 1edfe6d..2b2fe92 100644 --- a/src/Components/ArrayObj.php +++ b/src/Components/ArrayObj.php @@ -1,8 +1,8 @@ <?php + /** * Parses an array. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/CaseExpression.php b/src/Components/CaseExpression.php index 4d5189f..f6b422c 100644 --- a/src/Components/CaseExpression.php +++ b/src/Components/CaseExpression.php @@ -1,8 +1,8 @@ <?php + /** * Parses a reference to a CASE expression. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/Condition.php b/src/Components/Condition.php index e661a63..700b071 100644 --- a/src/Components/Condition.php +++ b/src/Components/Condition.php @@ -1,8 +1,8 @@ <?php + /** * `WHERE` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; @@ -87,7 +87,7 @@ class Condition extends Component */ public function __construct($expr = null) { - $this->expr = trim((string) $expr); + $this->expr = trim($expr); } /** diff --git a/src/Components/CreateDefinition.php b/src/Components/CreateDefinition.php index 922551b..ed79af7 100644 --- a/src/Components/CreateDefinition.php +++ b/src/Components/CreateDefinition.php @@ -1,10 +1,10 @@ <?php + /** * Parses the create definition of a column or a key. * * Used for parsing `CREATE TABLE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/DataType.php b/src/Components/DataType.php index 4af7a01..0d8dea3 100644 --- a/src/Components/DataType.php +++ b/src/Components/DataType.php @@ -1,8 +1,8 @@ <?php + /** * Parses a data type. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; @@ -127,7 +127,7 @@ class DataType extends Component } if ($state === 0) { - $ret->name = strtoupper((string) $token->value); + $ret->name = strtoupper($token->value); if (($token->type !== Token::TYPE_KEYWORD) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { $parser->error('Unrecognized data type.', $token); } diff --git a/src/Components/Expression.php b/src/Components/Expression.php index 4608754..8eff735 100644 --- a/src/Components/Expression.php +++ b/src/Components/Expression.php @@ -1,9 +1,9 @@ <?php + /** * Parses a reference to an expression (column, table or database name, function * call, mathematical expression, etc.). */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; @@ -269,7 +269,7 @@ class Expression extends Component continue; } $isExpr = true; - } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && ! $alias) { + } elseif ($brackets === 0 && strlen($ret->expr) > 0 && ! $alias) { /* End of expression */ break; } @@ -413,7 +413,7 @@ class Expression extends Component } // White-spaces might be added at the end. - $ret->expr = trim((string) $ret->expr); + $ret->expr = trim($ret->expr); if ($ret->expr === '') { return null; diff --git a/src/Components/ExpressionArray.php b/src/Components/ExpressionArray.php index 96dcb50..ab6988d 100644 --- a/src/Components/ExpressionArray.php +++ b/src/Components/ExpressionArray.php @@ -1,8 +1,8 @@ <?php + /** * Parses a list of expressions delimited by a comma. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/FunctionCall.php b/src/Components/FunctionCall.php index aaffbbb..8334676 100644 --- a/src/Components/FunctionCall.php +++ b/src/Components/FunctionCall.php @@ -1,8 +1,8 @@ <?php + /** * Parses a function call. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/GroupKeyword.php b/src/Components/GroupKeyword.php index a2006a7..c782288 100644 --- a/src/Components/GroupKeyword.php +++ b/src/Components/GroupKeyword.php @@ -1,8 +1,8 @@ <?php + /** * `GROUP BY` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; @@ -126,6 +126,6 @@ class GroupKeyword extends Component return implode(', ', $component); } - return trim((string) $component->expr); + return trim($component->expr); } } diff --git a/src/Components/IndexHint.php b/src/Components/IndexHint.php index 9284945..254152e 100644 --- a/src/Components/IndexHint.php +++ b/src/Components/IndexHint.php @@ -1,8 +1,8 @@ <?php + /** * Parses an Index hint. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/IntoKeyword.php b/src/Components/IntoKeyword.php index 593088c..a31f6a0 100644 --- a/src/Components/IntoKeyword.php +++ b/src/Components/IntoKeyword.php @@ -1,8 +1,8 @@ <?php + /** * `INTO` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/JoinKeyword.php b/src/Components/JoinKeyword.php index 6b630ba..afc62ba 100644 --- a/src/Components/JoinKeyword.php +++ b/src/Components/JoinKeyword.php @@ -1,8 +1,8 @@ <?php + /** * `JOIN` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/Key.php b/src/Components/Key.php index 6e4fd6b..bf87e54 100644 --- a/src/Components/Key.php +++ b/src/Components/Key.php @@ -1,8 +1,8 @@ <?php + /** * Parses the definition of a key. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/Limit.php b/src/Components/Limit.php index 85412fd..17423e2 100644 --- a/src/Components/Limit.php +++ b/src/Components/Limit.php @@ -1,8 +1,8 @@ <?php + /** * `LIMIT` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/LockExpression.php b/src/Components/LockExpression.php index ecbe0ee..1a2479d 100644 --- a/src/Components/LockExpression.php +++ b/src/Components/LockExpression.php @@ -1,8 +1,8 @@ <?php + /** * Parses a reference to a LOCK expression. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/OptionsArray.php b/src/Components/OptionsArray.php index 4cd35d2..69aabb3 100644 --- a/src/Components/OptionsArray.php +++ b/src/Components/OptionsArray.php @@ -1,8 +1,8 @@ <?php + /** * Parses a list of options. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/OrderKeyword.php b/src/Components/OrderKeyword.php index 81a408c..1e77f57 100644 --- a/src/Components/OrderKeyword.php +++ b/src/Components/OrderKeyword.php @@ -1,8 +1,8 @@ <?php + /** * `ORDER BY` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/ParameterDefinition.php b/src/Components/ParameterDefinition.php index 4cd5023..831ee4b 100644 --- a/src/Components/ParameterDefinition.php +++ b/src/Components/ParameterDefinition.php @@ -1,8 +1,8 @@ <?php + /** * The definition of a parameter of a function or procedure. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/PartitionDefinition.php b/src/Components/PartitionDefinition.php index 163ee7a..71f73b8 100644 --- a/src/Components/PartitionDefinition.php +++ b/src/Components/PartitionDefinition.php @@ -1,10 +1,10 @@ <?php + /** * Parses the create definition of a partition. * * Used for parsing `CREATE TABLE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/Reference.php b/src/Components/Reference.php index 56d639d..38fc060 100644 --- a/src/Components/Reference.php +++ b/src/Components/Reference.php @@ -1,8 +1,8 @@ <?php + /** * `REFERENCES` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/RenameOperation.php b/src/Components/RenameOperation.php index 785e07d..bf6167b 100644 --- a/src/Components/RenameOperation.php +++ b/src/Components/RenameOperation.php @@ -1,8 +1,8 @@ <?php + /** * `RENAME TABLE` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/SetOperation.php b/src/Components/SetOperation.php index 308f65e..d27819c 100644 --- a/src/Components/SetOperation.php +++ b/src/Components/SetOperation.php @@ -1,8 +1,8 @@ <?php + /** * `SET` keyword parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Components/UnionKeyword.php b/src/Components/UnionKeyword.php index e3768bc..2de5126 100644 --- a/src/Components/UnionKeyword.php +++ b/src/Components/UnionKeyword.php @@ -1,8 +1,8 @@ <?php + /** * `UNION` keyword builder. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; diff --git a/src/Context.php b/src/Context.php index 4c83b62..9625deb 100644 --- a/src/Context.php +++ b/src/Context.php @@ -1,11 +1,11 @@ <?php + /** * Defines a context class that is later extended to define other contexts. * * A context is a collection of keywords, operators and functions used for * parsing. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Contexts/ContextMariaDb100000.php b/src/Contexts/ContextMariaDb100000.php index 8171c0c..e4c368d 100644 --- a/src/Contexts/ContextMariaDb100000.php +++ b/src/Contexts/ContextMariaDb100000.php @@ -1,4 +1,5 @@ <?php + /** * Context for MariaDB 10.0. * @@ -6,7 +7,6 @@ * * @see https://mariadb.com/kb/en/the-mariadb-library/reserved-words/ */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMariaDb100100.php b/src/Contexts/ContextMariaDb100100.php index 5cfd747..26ce58b 100644 --- a/src/Contexts/ContextMariaDb100100.php +++ b/src/Contexts/ContextMariaDb100100.php @@ -1,4 +1,5 @@ <?php + /** * Context for MariaDB 10.1. * @@ -6,7 +7,6 @@ * * @see https://mariadb.com/kb/en/the-mariadb-library/reserved-words/ */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMariaDb100200.php b/src/Contexts/ContextMariaDb100200.php index 860fc65..911afe8 100644 --- a/src/Contexts/ContextMariaDb100200.php +++ b/src/Contexts/ContextMariaDb100200.php @@ -1,4 +1,5 @@ <?php + /** * Context for MariaDB 10.2. * @@ -6,7 +7,6 @@ * * @see https://mariadb.com/kb/en/the-mariadb-library/reserved-words/ */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMariaDb100300.php b/src/Contexts/ContextMariaDb100300.php index 74dcd73..e30ab04 100644 --- a/src/Contexts/ContextMariaDb100300.php +++ b/src/Contexts/ContextMariaDb100300.php @@ -1,4 +1,5 @@ <?php + /** * Context for MariaDB 10.3. * @@ -6,7 +7,6 @@ * * @see https://mariadb.com/kb/en/the-mariadb-library/reserved-words/ */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMySql50000.php b/src/Contexts/ContextMySql50000.php index 877336f..63f12fe 100644 --- a/src/Contexts/ContextMySql50000.php +++ b/src/Contexts/ContextMySql50000.php @@ -1,4 +1,5 @@ <?php + /** * Context for MySQL 5.0. * @@ -6,7 +7,6 @@ * * @see https://dev.mysql.com/doc/refman/5.0/en/keywords.html */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMySql50100.php b/src/Contexts/ContextMySql50100.php index 1c8bb5a..4b97896 100644 --- a/src/Contexts/ContextMySql50100.php +++ b/src/Contexts/ContextMySql50100.php @@ -1,4 +1,5 @@ <?php + /** * Context for MySQL 5.1. * @@ -6,7 +7,6 @@ * * @see https://dev.mysql.com/doc/refman/5.1/en/keywords.html */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMySql50500.php b/src/Contexts/ContextMySql50500.php index 2b21deb..4d1de76 100644 --- a/src/Contexts/ContextMySql50500.php +++ b/src/Contexts/ContextMySql50500.php @@ -1,4 +1,5 @@ <?php + /** * Context for MySQL 5.5. * @@ -6,7 +7,6 @@ * * @see https://dev.mysql.com/doc/refman/5.5/en/keywords.html */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMySql50600.php b/src/Contexts/ContextMySql50600.php index bec0d5f..e447ec7 100644 --- a/src/Contexts/ContextMySql50600.php +++ b/src/Contexts/ContextMySql50600.php @@ -1,4 +1,5 @@ <?php + /** * Context for MySQL 5.6. * @@ -6,7 +7,6 @@ * * @see https://dev.mysql.com/doc/refman/5.6/en/keywords.html */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMySql50700.php b/src/Contexts/ContextMySql50700.php index 8bb7a8b..bf77167 100644 --- a/src/Contexts/ContextMySql50700.php +++ b/src/Contexts/ContextMySql50700.php @@ -1,4 +1,5 @@ <?php + /** * Context for MySQL 5.7. * @@ -6,7 +7,6 @@ * * @see https://dev.mysql.com/doc/refman/5.7/en/keywords.html */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Contexts/ContextMySql80000.php b/src/Contexts/ContextMySql80000.php index b673484..05fc4c9 100644 --- a/src/Contexts/ContextMySql80000.php +++ b/src/Contexts/ContextMySql80000.php @@ -1,4 +1,5 @@ <?php + /** * Context for MySQL 8.0. * @@ -6,7 +7,6 @@ * * @see https://dev.mysql.com/doc/refman/8.0/en/keywords.html */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Contexts; diff --git a/src/Core.php b/src/Core.php index a55dd18..052ac5e 100644 --- a/src/Core.php +++ b/src/Core.php @@ -1,8 +1,8 @@ <?php + /** * Defines the core helper infrastructure of the library. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Exceptions/LexerException.php b/src/Exceptions/LexerException.php index 7dd85a4..61e88c9 100644 --- a/src/Exceptions/LexerException.php +++ b/src/Exceptions/LexerException.php @@ -1,8 +1,8 @@ <?php + /** * Exception thrown by the lexer. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Exceptions; diff --git a/src/Exceptions/LoaderException.php b/src/Exceptions/LoaderException.php index d809876..bfbd4c3 100644 --- a/src/Exceptions/LoaderException.php +++ b/src/Exceptions/LoaderException.php @@ -1,8 +1,8 @@ <?php + /** * Exception thrown by the lexer. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Exceptions; diff --git a/src/Exceptions/ParserException.php b/src/Exceptions/ParserException.php index 575eeb1..eb13653 100644 --- a/src/Exceptions/ParserException.php +++ b/src/Exceptions/ParserException.php @@ -1,8 +1,8 @@ <?php + /** * Exception thrown by the parser. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Exceptions; diff --git a/src/Lexer.php b/src/Lexer.php index 30bece7..895cb2b 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -1,4 +1,5 @@ <?php + /** * Defines the lexer of the library. * @@ -6,7 +7,6 @@ * * Depends on context to extract lexemes. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Parser.php b/src/Parser.php index ba19861..ab3e1b7 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -1,10 +1,10 @@ <?php + /** * Defines the parser of the library. * * This is one of the most important components, along with the lexer. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Statement.php b/src/Statement.php index 301fd24..d9027d9 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -1,11 +1,11 @@ <?php + /** * The result of the parser is an array of statements are extensions of the * class defined here. * * A statement represents the result of parsing the lexemes. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Statements/AlterStatement.php b/src/Statements/AlterStatement.php index b0c002d..ce0c824 100644 --- a/src/Statements/AlterStatement.php +++ b/src/Statements/AlterStatement.php @@ -1,8 +1,8 @@ <?php + /** * `ALTER` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/AnalyzeStatement.php b/src/Statements/AnalyzeStatement.php index 4294ae1..4f6ea32 100644 --- a/src/Statements/AnalyzeStatement.php +++ b/src/Statements/AnalyzeStatement.php @@ -1,8 +1,8 @@ <?php + /** * `ANALYZE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/BackupStatement.php b/src/Statements/BackupStatement.php index e6abefa..52f136b 100644 --- a/src/Statements/BackupStatement.php +++ b/src/Statements/BackupStatement.php @@ -1,8 +1,8 @@ <?php + /** * `BACKUP` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/CallStatement.php b/src/Statements/CallStatement.php index 570d3a8..00cb95c 100644 --- a/src/Statements/CallStatement.php +++ b/src/Statements/CallStatement.php @@ -1,8 +1,8 @@ <?php + /** * `CALL` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/CheckStatement.php b/src/Statements/CheckStatement.php index cf72003..57e5cb7 100644 --- a/src/Statements/CheckStatement.php +++ b/src/Statements/CheckStatement.php @@ -1,8 +1,8 @@ <?php + /** * `CHECK` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/ChecksumStatement.php b/src/Statements/ChecksumStatement.php index 239168d..1be2588 100644 --- a/src/Statements/ChecksumStatement.php +++ b/src/Statements/ChecksumStatement.php @@ -1,8 +1,8 @@ <?php + /** * `CHECKSUM` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/CreateStatement.php b/src/Statements/CreateStatement.php index 54a5e5f..17c5bf1 100644 --- a/src/Statements/CreateStatement.php +++ b/src/Statements/CreateStatement.php @@ -1,8 +1,8 @@ <?php + /** * `CREATE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/DeleteStatement.php b/src/Statements/DeleteStatement.php index 823266d..088489d 100644 --- a/src/Statements/DeleteStatement.php +++ b/src/Statements/DeleteStatement.php @@ -1,8 +1,8 @@ <?php + /** * `DELETE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; @@ -184,7 +184,7 @@ class DeleteStatement extends Statement if (! is_null($this->order) && count($this->order) > 0) { $ret .= ' ORDER BY ' . ExpressionArray::build($this->order); } - if (! is_null($this->limit) && strlen((string) $this->limit) > 0) { + if (! is_null($this->limit) && strlen($this->limit) > 0) { $ret .= ' LIMIT ' . Limit::build($this->limit); } diff --git a/src/Statements/DropStatement.php b/src/Statements/DropStatement.php index 3fcedcb..e6f9591 100644 --- a/src/Statements/DropStatement.php +++ b/src/Statements/DropStatement.php @@ -1,8 +1,8 @@ <?php + /** * `DROP` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/ExplainStatement.php b/src/Statements/ExplainStatement.php index 65ea597..96a5828 100644 --- a/src/Statements/ExplainStatement.php +++ b/src/Statements/ExplainStatement.php @@ -1,8 +1,8 @@ <?php + /** * `EXPLAIN` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/InsertStatement.php b/src/Statements/InsertStatement.php index 6258903..c65931e 100644 --- a/src/Statements/InsertStatement.php +++ b/src/Statements/InsertStatement.php @@ -1,8 +1,8 @@ <?php + /** * `INSERT` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; @@ -117,7 +117,7 @@ class InsertStatement extends Statement $ret .= ' VALUES ' . Array2d::build($this->values); } elseif (! is_null($this->set) && count($this->set) > 0) { $ret .= ' SET ' . SetOperation::build($this->set); - } elseif (! is_null($this->select) && strlen((string) $this->select) > 0) { + } elseif (! is_null($this->select) && strlen($this->select) > 0) { $ret .= ' ' . $this->select->build(); } diff --git a/src/Statements/LoadStatement.php b/src/Statements/LoadStatement.php index 96ea8ae..6eb182a 100644 --- a/src/Statements/LoadStatement.php +++ b/src/Statements/LoadStatement.php @@ -1,8 +1,8 @@ <?php + /** * `LOAD` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; @@ -194,7 +194,7 @@ class LoadStatement extends Statement $ret .= ' INTO TABLE ' . $this->table; - if ($this->partition !== null && strlen((string) $this->partition) > 0) { + if ($this->partition !== null && strlen($this->partition) > 0) { $ret .= ' PARTITION ' . ArrayObj::build($this->partition); } @@ -206,7 +206,7 @@ class LoadStatement extends Statement $ret .= ' ' . $this->fields_keyword . ' ' . $this->fields_options; } - if ($this->lines_options !== null && strlen((string) $this->lines_options) > 0) { + if ($this->lines_options !== null && strlen($this->lines_options) > 0) { $ret .= ' LINES ' . $this->lines_options; } diff --git a/src/Statements/LockStatement.php b/src/Statements/LockStatement.php index 19e6eb4..d4c6cb1 100644 --- a/src/Statements/LockStatement.php +++ b/src/Statements/LockStatement.php @@ -1,8 +1,8 @@ <?php + /** * `LOCK` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/MaintenanceStatement.php b/src/Statements/MaintenanceStatement.php index c59bb77..ac3b8c9 100644 --- a/src/Statements/MaintenanceStatement.php +++ b/src/Statements/MaintenanceStatement.php @@ -1,8 +1,8 @@ <?php + /** * Maintenance statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/NotImplementedStatement.php b/src/Statements/NotImplementedStatement.php index 67c1bea..e534cdf 100644 --- a/src/Statements/NotImplementedStatement.php +++ b/src/Statements/NotImplementedStatement.php @@ -1,8 +1,8 @@ <?php + /** * Not implemented (yet) statements. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/OptimizeStatement.php b/src/Statements/OptimizeStatement.php index 64b1d1a..1aff056 100644 --- a/src/Statements/OptimizeStatement.php +++ b/src/Statements/OptimizeStatement.php @@ -1,8 +1,8 @@ <?php + /** * `OPTIMIZE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/PurgeStatement.php b/src/Statements/PurgeStatement.php index ccae64e..0374813 100644 --- a/src/Statements/PurgeStatement.php +++ b/src/Statements/PurgeStatement.php @@ -1,8 +1,8 @@ <?php + /** * `PURGE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/RenameStatement.php b/src/Statements/RenameStatement.php index 17662d3..e1bcf0d 100644 --- a/src/Statements/RenameStatement.php +++ b/src/Statements/RenameStatement.php @@ -1,8 +1,8 @@ <?php + /** * `RENAME` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/RepairStatement.php b/src/Statements/RepairStatement.php index a14e514..fb76855 100644 --- a/src/Statements/RepairStatement.php +++ b/src/Statements/RepairStatement.php @@ -1,8 +1,8 @@ <?php + /** * `REPAIR` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/ReplaceStatement.php b/src/Statements/ReplaceStatement.php index 296eef8..d912da0 100644 --- a/src/Statements/ReplaceStatement.php +++ b/src/Statements/ReplaceStatement.php @@ -1,8 +1,8 @@ <?php + /** * `REPLACE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; @@ -94,7 +94,7 @@ class ReplaceStatement extends Statement $ret .= ' VALUES ' . Array2d::build($this->values); } elseif (! is_null($this->set) && count($this->set) > 0) { $ret .= ' SET ' . SetOperation::build($this->set); - } elseif (! is_null($this->select) && strlen((string) $this->select) > 0) { + } elseif (! is_null($this->select) && strlen($this->select) > 0) { $ret .= ' ' . $this->select->build(); } diff --git a/src/Statements/RestoreStatement.php b/src/Statements/RestoreStatement.php index 28dd4c9..a7bf2c8 100644 --- a/src/Statements/RestoreStatement.php +++ b/src/Statements/RestoreStatement.php @@ -1,8 +1,8 @@ <?php + /** * `RESTORE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/SelectStatement.php b/src/Statements/SelectStatement.php index 1e8150f..852dc0b 100644 --- a/src/Statements/SelectStatement.php +++ b/src/Statements/SelectStatement.php @@ -1,8 +1,8 @@ <?php + /** * `SELECT` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/SetStatement.php b/src/Statements/SetStatement.php index a499045..2643578 100644 --- a/src/Statements/SetStatement.php +++ b/src/Statements/SetStatement.php @@ -1,8 +1,8 @@ <?php + /** * `SET` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/ShowStatement.php b/src/Statements/ShowStatement.php index e2b0d58..1e9e67e 100644 --- a/src/Statements/ShowStatement.php +++ b/src/Statements/ShowStatement.php @@ -1,8 +1,8 @@ <?php + /** * `SHOW` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/TransactionStatement.php b/src/Statements/TransactionStatement.php index c61cd37..59bd9c6 100644 --- a/src/Statements/TransactionStatement.php +++ b/src/Statements/TransactionStatement.php @@ -1,8 +1,8 @@ <?php + /** * Transaction statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/TruncateStatement.php b/src/Statements/TruncateStatement.php index 7498f03..eb791d0 100644 --- a/src/Statements/TruncateStatement.php +++ b/src/Statements/TruncateStatement.php @@ -1,8 +1,8 @@ <?php + /** * `TRUNCATE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Statements/UpdateStatement.php b/src/Statements/UpdateStatement.php index 722fbf5..da7d741 100644 --- a/src/Statements/UpdateStatement.php +++ b/src/Statements/UpdateStatement.php @@ -1,8 +1,8 @@ <?php + /** * `UPDATE` statement. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; diff --git a/src/Token.php b/src/Token.php index ad5011e..f2f9860 100644 --- a/src/Token.php +++ b/src/Token.php @@ -1,10 +1,10 @@ <?php + /** * Defines a token along with a set of types and flags and utility functions. * * An array of tokens will result after parsing the query. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/TokensList.php b/src/TokensList.php index 32b4819..5c04ad4 100644 --- a/src/TokensList.php +++ b/src/TokensList.php @@ -1,8 +1,8 @@ <?php + /** * Defines an array of tokens and utility functions to iterate through it. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Translator.php b/src/Translator.php index a169632..622bec9 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -1,8 +1,8 @@ <?php + /** * Defines the localization helper infrastructure of the library. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/UtfString.php b/src/UtfString.php index 9e6e55b..58905f3 100644 --- a/src/UtfString.php +++ b/src/UtfString.php @@ -1,4 +1,5 @@ <?php + /** * Implementation for UTF-8 strings. * @@ -9,7 +10,6 @@ * Because the lexer relies on the subscript operator this class had to be * implemented. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser; diff --git a/src/Utils/BufferedQuery.php b/src/Utils/BufferedQuery.php index 5597dcf..db9c4e5 100644 --- a/src/Utils/BufferedQuery.php +++ b/src/Utils/BufferedQuery.php @@ -1,8 +1,8 @@ <?php + /** * Buffered query utilities. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; diff --git a/src/Utils/CLI.php b/src/Utils/CLI.php index 07afad1..2acc81c 100644 --- a/src/Utils/CLI.php +++ b/src/Utils/CLI.php @@ -1,8 +1,8 @@ <?php + /** * CLI interface. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; diff --git a/src/Utils/Error.php b/src/Utils/Error.php index 1b1e65a..20310a1 100644 --- a/src/Utils/Error.php +++ b/src/Utils/Error.php @@ -1,8 +1,8 @@ <?php + /** * Error related utilities. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; @@ -86,7 +86,7 @@ class Error ++$i, $err[0], $err[1], - htmlspecialchars((string) $err[2]), + htmlspecialchars($err[2]), $err[3] ); } diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index ab92cbb..b608b73 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -1,8 +1,8 @@ <?php + /** * Utilities that are used for formatting queries. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; @@ -507,7 +507,7 @@ class Formatter // No space after . ( || ($curr->type === Token::TYPE_OPERATOR && ($curr->value === '.' || $curr->value === ',' || $curr->value === '(' || $curr->value === ')')) // No space before . , ( ) - || $curr->type === Token::TYPE_DELIMITER && mb_strlen((string) $curr->value, 'UTF-8') < 2 + || $curr->type === Token::TYPE_DELIMITER && mb_strlen($curr->value, 'UTF-8') < 2 ) ) { $ret .= ' '; @@ -713,7 +713,7 @@ class Formatter } // Keeping track of this group's length. - $length += mb_strlen((string) $list->tokens[$idx]->value, 'UTF-8'); + $length += mb_strlen($list->tokens[$idx]->value, 'UTF-8'); } return $length; diff --git a/src/Utils/Misc.php b/src/Utils/Misc.php index 0ce25d9..7e6297f 100644 --- a/src/Utils/Misc.php +++ b/src/Utils/Misc.php @@ -1,8 +1,8 @@ <?php + /** * Miscellaneous utilities. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; diff --git a/src/Utils/Query.php b/src/Utils/Query.php index 834e642..2e623aa 100644 --- a/src/Utils/Query.php +++ b/src/Utils/Query.php @@ -1,8 +1,8 @@ <?php + /** * Statement utilities. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; diff --git a/src/Utils/Routine.php b/src/Utils/Routine.php index 89ab153..9b075dc 100644 --- a/src/Utils/Routine.php +++ b/src/Utils/Routine.php @@ -1,8 +1,8 @@ <?php + /** * Routine utilities. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; diff --git a/src/Utils/Table.php b/src/Utils/Table.php index ad87b75..e73e430 100644 --- a/src/Utils/Table.php +++ b/src/Utils/Table.php @@ -1,8 +1,8 @@ <?php + /** * Table utilities. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; diff --git a/src/Utils/Tokens.php b/src/Utils/Tokens.php index 7249ca0..9166085 100644 --- a/src/Utils/Tokens.php +++ b/src/Utils/Tokens.php @@ -1,8 +1,8 @@ <?php + /** * Token utilities. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Utils; @@ -44,7 +44,7 @@ class Tokens } if (isset($pattern['value_str']) - && strcasecmp($pattern['value_str'], (string) $token->value) + && strcasecmp($pattern['value_str'], $token->value) ) { return false; } diff --git a/tests/Builder/AlterStatementTest.php b/tests/Builder/AlterStatementTest.php index 70236e4..2372b6d 100644 --- a/tests/Builder/AlterStatementTest.php +++ b/tests/Builder/AlterStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/CreateStatementTest.php b/tests/Builder/CreateStatementTest.php index 9f1e0a6..52f4f00 100644 --- a/tests/Builder/CreateStatementTest.php +++ b/tests/Builder/CreateStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/DeleteStatementTest.php b/tests/Builder/DeleteStatementTest.php index 0327e03..5aa037e 100644 --- a/tests/Builder/DeleteStatementTest.php +++ b/tests/Builder/DeleteStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/ExplainStatementTest.php b/tests/Builder/ExplainStatementTest.php index 7b6215f..44bb817 100644 --- a/tests/Builder/ExplainStatementTest.php +++ b/tests/Builder/ExplainStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/InsertStatementTest.php b/tests/Builder/InsertStatementTest.php index 2152665..5e3360d 100644 --- a/tests/Builder/InsertStatementTest.php +++ b/tests/Builder/InsertStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/LoadStatementTest.php b/tests/Builder/LoadStatementTest.php index 051e13d..4c4e9b1 100644 --- a/tests/Builder/LoadStatementTest.php +++ b/tests/Builder/LoadStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/LockStatementTest.php b/tests/Builder/LockStatementTest.php index 8593a87..b0b4d38 100644 --- a/tests/Builder/LockStatementTest.php +++ b/tests/Builder/LockStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/PurgeStatementTest.php b/tests/Builder/PurgeStatementTest.php index aae52b5..caa1652 100644 --- a/tests/Builder/PurgeStatementTest.php +++ b/tests/Builder/PurgeStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/RenameStatementTest.php b/tests/Builder/RenameStatementTest.php index e803786..97852ab 100644 --- a/tests/Builder/RenameStatementTest.php +++ b/tests/Builder/RenameStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/ReplaceStatementTest.php b/tests/Builder/ReplaceStatementTest.php index ee5b95a..b1a6c91 100644 --- a/tests/Builder/ReplaceStatementTest.php +++ b/tests/Builder/ReplaceStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/SelectStatementTest.php b/tests/Builder/SelectStatementTest.php index 5d9836f..bec4b53 100644 --- a/tests/Builder/SelectStatementTest.php +++ b/tests/Builder/SelectStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/SetStatementTest.php b/tests/Builder/SetStatementTest.php index 406e369..746e92f 100644 --- a/tests/Builder/SetStatementTest.php +++ b/tests/Builder/SetStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/StatementTest.php b/tests/Builder/StatementTest.php index b75b5d5..f97044d 100644 --- a/tests/Builder/StatementTest.php +++ b/tests/Builder/StatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Builder/TransactionStatementTest.php b/tests/Builder/TransactionStatementTest.php index 5cd28c6..d7fd73c 100644 --- a/tests/Builder/TransactionStatementTest.php +++ b/tests/Builder/TransactionStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; diff --git a/tests/Components/Array2dTest.php b/tests/Components/Array2dTest.php index 5232330..83e6215 100644 --- a/tests/Components/Array2dTest.php +++ b/tests/Components/Array2dTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/ArrayObjTest.php b/tests/Components/ArrayObjTest.php index dac9947..3664e1c 100644 --- a/tests/Components/ArrayObjTest.php +++ b/tests/Components/ArrayObjTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/CaseExpressionTest.php b/tests/Components/CaseExpressionTest.php index 2ea8f8b..b337cb1 100644 --- a/tests/Components/CaseExpressionTest.php +++ b/tests/Components/CaseExpressionTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/ComponentTest.php b/tests/Components/ComponentTest.php index 2595202..13dbdf4 100644 --- a/tests/Components/ComponentTest.php +++ b/tests/Components/ComponentTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/ConditionTest.php b/tests/Components/ConditionTest.php index eb8cca1..27c6a4f 100644 --- a/tests/Components/ConditionTest.php +++ b/tests/Components/ConditionTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/CreateDefinitionTest.php b/tests/Components/CreateDefinitionTest.php index 6b97cb1..3683e29 100644 --- a/tests/Components/CreateDefinitionTest.php +++ b/tests/Components/CreateDefinitionTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/ExpressionArrayTest.php b/tests/Components/ExpressionArrayTest.php index 9c7bd72..f500f8a 100644 --- a/tests/Components/ExpressionArrayTest.php +++ b/tests/Components/ExpressionArrayTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/ExpressionTest.php b/tests/Components/ExpressionTest.php index 453755d..45b8be5 100644 --- a/tests/Components/ExpressionTest.php +++ b/tests/Components/ExpressionTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/FunctionCallTest.php b/tests/Components/FunctionCallTest.php index d9da50c..c4c0c26 100644 --- a/tests/Components/FunctionCallTest.php +++ b/tests/Components/FunctionCallTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/GroupKeywordTest.php b/tests/Components/GroupKeywordTest.php index c31ed58..8d4a407 100644 --- a/tests/Components/GroupKeywordTest.php +++ b/tests/Components/GroupKeywordTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/IntoKeywordTest.php b/tests/Components/IntoKeywordTest.php index 896c363..2ebf5ee 100644 --- a/tests/Components/IntoKeywordTest.php +++ b/tests/Components/IntoKeywordTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/JoinKeywordTest.php b/tests/Components/JoinKeywordTest.php index 3eb2aab..8baf93f 100644 --- a/tests/Components/JoinKeywordTest.php +++ b/tests/Components/JoinKeywordTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/KeyTest.php b/tests/Components/KeyTest.php index aeb403d..c27b9d8 100644 --- a/tests/Components/KeyTest.php +++ b/tests/Components/KeyTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/LimitTest.php b/tests/Components/LimitTest.php index 5e544d7..9e00a65 100644 --- a/tests/Components/LimitTest.php +++ b/tests/Components/LimitTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/LockExpressionTest.php b/tests/Components/LockExpressionTest.php index 348e38d..00d5ffb 100644 --- a/tests/Components/LockExpressionTest.php +++ b/tests/Components/LockExpressionTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/OptionsArrayTest.php b/tests/Components/OptionsArrayTest.php index 23a4e6b..bebf62f 100644 --- a/tests/Components/OptionsArrayTest.php +++ b/tests/Components/OptionsArrayTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/OrderKeywordTest.php b/tests/Components/OrderKeywordTest.php index 42c9b98..bc07d03 100644 --- a/tests/Components/OrderKeywordTest.php +++ b/tests/Components/OrderKeywordTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/ParameterDefinitionTest.php b/tests/Components/ParameterDefinitionTest.php index 38d28e0..683eb3a 100644 --- a/tests/Components/ParameterDefinitionTest.php +++ b/tests/Components/ParameterDefinitionTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/PartitionDefinitionTest.php b/tests/Components/PartitionDefinitionTest.php index 93bc4d5..7edc21e 100644 --- a/tests/Components/PartitionDefinitionTest.php +++ b/tests/Components/PartitionDefinitionTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/ReferenceTest.php b/tests/Components/ReferenceTest.php index 898362a..dc142fe 100644 --- a/tests/Components/ReferenceTest.php +++ b/tests/Components/ReferenceTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Components/RenameOperationTest.php b/tests/Components/RenameOperationTest.php index 6f38605..919c4bd 100644 --- a/tests/Components/RenameOperationTest.php +++ b/tests/Components/RenameOperationTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; diff --git a/tests/Lexer/ContextTest.php b/tests/Lexer/ContextTest.php index 208e623..6116db2 100644 --- a/tests/Lexer/ContextTest.php +++ b/tests/Lexer/ContextTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Lexer; diff --git a/tests/Lexer/IsMethodsTest.php b/tests/Lexer/IsMethodsTest.php index 9095907..56552c7 100644 --- a/tests/Lexer/IsMethodsTest.php +++ b/tests/Lexer/IsMethodsTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Lexer; diff --git a/tests/Lexer/LexerTest.php b/tests/Lexer/LexerTest.php index 1bfcb8f..7bc2da5 100644 --- a/tests/Lexer/LexerTest.php +++ b/tests/Lexer/LexerTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Lexer; diff --git a/tests/Lexer/TokenTest.php b/tests/Lexer/TokenTest.php index ba61e32..68d3b00 100644 --- a/tests/Lexer/TokenTest.php +++ b/tests/Lexer/TokenTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Lexer; diff --git a/tests/Lexer/TokensListTest.php b/tests/Lexer/TokensListTest.php index 214f0cd..c1c4414 100644 --- a/tests/Lexer/TokensListTest.php +++ b/tests/Lexer/TokensListTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Lexer; diff --git a/tests/Misc/BugsTest.php b/tests/Misc/BugsTest.php index 67fd07d..d356b57 100644 --- a/tests/Misc/BugsTest.php +++ b/tests/Misc/BugsTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Misc; diff --git a/tests/Misc/ParameterTest.php b/tests/Misc/ParameterTest.php index 146733e..f2d5280 100644 --- a/tests/Misc/ParameterTest.php +++ b/tests/Misc/ParameterTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Misc; diff --git a/tests/Misc/UtfStringTest.php b/tests/Misc/UtfStringTest.php index a80a077..36f0298 100644 --- a/tests/Misc/UtfStringTest.php +++ b/tests/Misc/UtfStringTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Misc; diff --git a/tests/Parser/AlterStatementTest.php b/tests/Parser/AlterStatementTest.php index 5748b13..7386bd4 100644 --- a/tests/Parser/AlterStatementTest.php +++ b/tests/Parser/AlterStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/CallStatementTest.php b/tests/Parser/CallStatementTest.php index a8501ef..a90d27a 100644 --- a/tests/Parser/CallStatementTest.php +++ b/tests/Parser/CallStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/CreateStatementTest.php b/tests/Parser/CreateStatementTest.php index 39344a9..5f0c8ac 100644 --- a/tests/Parser/CreateStatementTest.php +++ b/tests/Parser/CreateStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/DeleteStatementTest.php b/tests/Parser/DeleteStatementTest.php index 7edbd4b..75f3b09 100644 --- a/tests/Parser/DeleteStatementTest.php +++ b/tests/Parser/DeleteStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/ExplainStatementTest.php b/tests/Parser/ExplainStatementTest.php index dd3035e..db66a0a 100644 --- a/tests/Parser/ExplainStatementTest.php +++ b/tests/Parser/ExplainStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/InsertStatementTest.php b/tests/Parser/InsertStatementTest.php index 0bea14c..f0e4b5d 100644 --- a/tests/Parser/InsertStatementTest.php +++ b/tests/Parser/InsertStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/LoadStatementTest.php b/tests/Parser/LoadStatementTest.php index 40c6505..70d0a64 100644 --- a/tests/Parser/LoadStatementTest.php +++ b/tests/Parser/LoadStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/LockStatementTest.php b/tests/Parser/LockStatementTest.php index c740768..5460254 100644 --- a/tests/Parser/LockStatementTest.php +++ b/tests/Parser/LockStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/ParserTest.php b/tests/Parser/ParserTest.php index f2344b5..57c4aae 100644 --- a/tests/Parser/ParserTest.php +++ b/tests/Parser/ParserTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/PurgeStatementTest.php b/tests/Parser/PurgeStatementTest.php index 6e898fa..364c5a3 100644 --- a/tests/Parser/PurgeStatementTest.php +++ b/tests/Parser/PurgeStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/RenameStatementTest.php b/tests/Parser/RenameStatementTest.php index 9851daf..bb13c3c 100644 --- a/tests/Parser/RenameStatementTest.php +++ b/tests/Parser/RenameStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/ReplaceStatementTest.php b/tests/Parser/ReplaceStatementTest.php index a2495fe..edac536 100644 --- a/tests/Parser/ReplaceStatementTest.php +++ b/tests/Parser/ReplaceStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/RestoreStatementTest.php b/tests/Parser/RestoreStatementTest.php index b3af48e..7fa9a5d 100644 --- a/tests/Parser/RestoreStatementTest.php +++ b/tests/Parser/RestoreStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/SelectStatementTest.php b/tests/Parser/SelectStatementTest.php index d90ea41..b19b3cf 100644 --- a/tests/Parser/SelectStatementTest.php +++ b/tests/Parser/SelectStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/SetStatementTest.php b/tests/Parser/SetStatementTest.php index 76fd30d..9d31659 100644 --- a/tests/Parser/SetStatementTest.php +++ b/tests/Parser/SetStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/TransactionStatementTest.php b/tests/Parser/TransactionStatementTest.php index 6f60b78..599015f 100644 --- a/tests/Parser/TransactionStatementTest.php +++ b/tests/Parser/TransactionStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/Parser/UpdateStatementTest.php b/tests/Parser/UpdateStatementTest.php index 4758fea..210e1ab 100644 --- a/tests/Parser/UpdateStatementTest.php +++ b/tests/Parser/UpdateStatementTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Parser; diff --git a/tests/TestCase.php b/tests/TestCase.php index ab3578f..fb6af8d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,8 +1,8 @@ <?php + /** * Bootstrap for tests. */ -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests; diff --git a/tests/Utils/BufferedQueryTest.php b/tests/Utils/BufferedQueryTest.php index 860c7a8..164c31e 100644 --- a/tests/Utils/BufferedQueryTest.php +++ b/tests/Utils/BufferedQueryTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/CLITest.php b/tests/Utils/CLITest.php index e7df41d..4a81f61 100644 --- a/tests/Utils/CLITest.php +++ b/tests/Utils/CLITest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/ErrorTest.php b/tests/Utils/ErrorTest.php index 36dc198..fb441f8 100644 --- a/tests/Utils/ErrorTest.php +++ b/tests/Utils/ErrorTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/FormatterTest.php b/tests/Utils/FormatterTest.php index 15532e5..aa84564 100644 --- a/tests/Utils/FormatterTest.php +++ b/tests/Utils/FormatterTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/MiscTest.php b/tests/Utils/MiscTest.php index 01c1e10..3abc1cb 100644 --- a/tests/Utils/MiscTest.php +++ b/tests/Utils/MiscTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/QueryTest.php b/tests/Utils/QueryTest.php index 6c9bd97..3bc1783 100644 --- a/tests/Utils/QueryTest.php +++ b/tests/Utils/QueryTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/RoutineTest.php b/tests/Utils/RoutineTest.php index fe45798..c988b91 100644 --- a/tests/Utils/RoutineTest.php +++ b/tests/Utils/RoutineTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/TableTest.php b/tests/Utils/TableTest.php index 06aa1fb..ade4929 100644 --- a/tests/Utils/TableTest.php +++ b/tests/Utils/TableTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tests/Utils/TokensTest.php b/tests/Utils/TokensTest.php index 4d38a1a..685c670 100644 --- a/tests/Utils/TokensTest.php +++ b/tests/Utils/TokensTest.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Utils; diff --git a/tools/ContextGenerator.php b/tools/ContextGenerator.php index 2f76a74..d4c5407 100644 --- a/tools/ContextGenerator.php +++ b/tools/ContextGenerator.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tools; @@ -57,6 +56,7 @@ class ContextGenerator */ const TEMPLATE = '<?php' . "\n" . + '' . "\n" . '/**' . "\n" . ' * Context for %1$s.' . "\n" . ' *' . "\n" . @@ -64,7 +64,6 @@ class ContextGenerator ' *' . "\n" . ' * @see %3$s' . "\n" . ' */' . "\n" . - 'declare(strict_types=1);' . "\n" . '' . "\n" . 'namespace PhpMyAdmin\\SqlParser\\Contexts;' . "\n" . '' . "\n" . diff --git a/tools/TestGenerator.php b/tools/TestGenerator.php index e429990..6867fed 100644 --- a/tools/TestGenerator.php +++ b/tools/TestGenerator.php @@ -1,5 +1,4 @@ <?php -declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tools; |