diff options
author | William Desportes <williamdes@wdes.fr> | 2019-05-28 13:00:00 +0200 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2019-05-28 15:08:32 +0200 |
commit | 5d5089a259d0195c4a1e4aa3588c31c839954067 (patch) | |
tree | 645dab617127089baadcf5e3eed95e0f21a5b46c /src | |
parent | 724b2330dc4cb6247aa1649cc1f49fce496f2e3c (diff) | |
download | sql-parser-5d5089a259d0195c4a1e4aa3588c31c839954067.zip sql-parser-5d5089a259d0195c4a1e4aa3588c31c839954067.tar.gz sql-parser-5d5089a259d0195c4a1e4aa3588c31c839954067.tar.bz2 |
Revert array syntax
See: 86c5baebda24c1721fb6881df8671a3c7df60e8b
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'src')
44 files changed, 137 insertions, 137 deletions
diff --git a/src/Component.php b/src/Component.php index 520735b..ae05bd8 100644 --- a/src/Component.php +++ b/src/Component.php @@ -36,7 +36,7 @@ abstract class Component public static function parse( Parser $parser, TokensList $list, - array $options = [] + array $options = array() ) { // This method should be abstract, but it can't be both static and // abstract. @@ -56,7 +56,7 @@ abstract class Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { // This method should be abstract, but it can't be both static and // abstract. diff --git a/src/Components/AlterOperation.php b/src/Components/AlterOperation.php index 9d2393a..fc06644 100644 --- a/src/Components/AlterOperation.php +++ b/src/Components/AlterOperation.php @@ -153,7 +153,7 @@ class AlterOperation extends Component * * @var Token[]|string */ - public $unknown = []; + public $unknown = array(); /** * Constructor. @@ -165,7 +165,7 @@ class AlterOperation extends Component public function __construct( $options = null, $field = null, - $unknown = [] + $unknown = array() ) { $this->options = $options; $this->field = $field; @@ -179,7 +179,7 @@ class AlterOperation extends Component * * @return AlterOperation */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -315,7 +315,7 @@ class AlterOperation extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { $ret = $component->options . ' '; if ((isset($component->field)) && ($component->field !== '')) { diff --git a/src/Components/Array2d.php b/src/Components/Array2d.php index 7c99952..29e9dac 100644 --- a/src/Components/Array2d.php +++ b/src/Components/Array2d.php @@ -28,9 +28,9 @@ class Array2d extends Component * * @return ArrayObj[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); /** * The number of values in each set. @@ -124,7 +124,7 @@ class Array2d extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { return ArrayObj::build($component); } diff --git a/src/Components/ArrayObj.php b/src/Components/ArrayObj.php index 7748be9..769ce37 100644 --- a/src/Components/ArrayObj.php +++ b/src/Components/ArrayObj.php @@ -25,14 +25,14 @@ class ArrayObj extends Component * * @var array */ - public $raw = []; + public $raw = array(); /** * The array that contains the processed value of each token. * * @var array */ - public $values = []; + public $values = array(); /** * Constructor. @@ -40,7 +40,7 @@ class ArrayObj extends Component * @param array $raw the unprocessed values * @param array $values the processed values */ - public function __construct(array $raw = [], array $values = []) + public function __construct(array $raw = array(), array $values = array()) { $this->raw = $raw; $this->values = $values; @@ -53,9 +53,9 @@ class ArrayObj extends Component * * @return ArrayObj|Component[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = empty($options['type']) ? new self() : []; + $ret = empty($options['type']) ? new self() : array(); /** * The last raw expression. @@ -176,7 +176,7 @@ class ArrayObj extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(', ', $component); diff --git a/src/Components/CaseExpression.php b/src/Components/CaseExpression.php index 309f0ff..468cf6d 100644 --- a/src/Components/CaseExpression.php +++ b/src/Components/CaseExpression.php @@ -33,21 +33,21 @@ class CaseExpression extends Component * * @var array */ - public $conditions = []; + public $conditions = array(); /** * The results matching with the WHEN clauses. * * @var array */ - public $results = []; + public $results = array(); /** * The values to be compared against. * * @var array */ - public $compare_values = []; + public $compare_values = array(); /** * The result in ELSE section of expr. @@ -84,7 +84,7 @@ class CaseExpression extends Component * * @return CaseExpression */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -279,7 +279,7 @@ class CaseExpression extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { $ret = 'CASE '; if (isset($component->value)) { diff --git a/src/Components/Condition.php b/src/Components/Condition.php index c37ce19..edf01b0 100644 --- a/src/Components/Condition.php +++ b/src/Components/Condition.php @@ -64,7 +64,7 @@ class Condition extends Component * * @var array */ - public $identifiers = []; + public $identifiers = array(); /** * Whether this component is an operator. @@ -97,9 +97,9 @@ class Condition extends Component * * @return Condition[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -222,7 +222,7 @@ class Condition extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(' ', $component); diff --git a/src/Components/CreateDefinition.php b/src/Components/CreateDefinition.php index 3d3a3f4..506832a 100644 --- a/src/Components/CreateDefinition.php +++ b/src/Components/CreateDefinition.php @@ -172,9 +172,9 @@ class CreateDefinition extends Component * * @return CreateDefinition[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -326,7 +326,7 @@ class CreateDefinition extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return "(\n " . implode(",\n ", $component) . "\n)"; diff --git a/src/Components/DataType.php b/src/Components/DataType.php index 5be45c6..75a70fc 100644 --- a/src/Components/DataType.php +++ b/src/Components/DataType.php @@ -63,7 +63,7 @@ class DataType extends Component * * @var array */ - public $parameters = []; + public $parameters = array(); /** * The options of this data type. @@ -81,7 +81,7 @@ class DataType extends Component */ public function __construct( $name = null, - array $parameters = [], + array $parameters = array(), $options = null ) { $this->name = $name; @@ -96,7 +96,7 @@ class DataType extends Component * * @return DataType */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -160,7 +160,7 @@ class DataType extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { $name = empty($options['lowercase']) ? $component->name : strtolower($component->name); diff --git a/src/Components/Expression.php b/src/Components/Expression.php index 7a71c76..1cac3a0 100644 --- a/src/Components/Expression.php +++ b/src/Components/Expression.php @@ -155,7 +155,7 @@ class Expression extends Component * * @return Expression */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -430,7 +430,7 @@ class Expression extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode($component, ', '); @@ -439,7 +439,7 @@ class Expression extends Component if ($component->expr !== '' && ! is_null($component->expr)) { $ret = $component->expr; } else { - $fields = []; + $fields = array(); if (isset($component->database) && ($component->database !== '')) { $fields[] = $component->database; } diff --git a/src/Components/ExpressionArray.php b/src/Components/ExpressionArray.php index 2f44d7a..96dcb50 100644 --- a/src/Components/ExpressionArray.php +++ b/src/Components/ExpressionArray.php @@ -27,9 +27,9 @@ class ExpressionArray extends Component * * @return Expression[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); /** * The state of the parser. @@ -115,9 +115,9 @@ class ExpressionArray extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { - $ret = []; + $ret = array(); foreach ($component as $frag) { $ret[] = $frag::build($frag); } diff --git a/src/Components/FunctionCall.php b/src/Components/FunctionCall.php index 382ee8f..aaffbbb 100644 --- a/src/Components/FunctionCall.php +++ b/src/Components/FunctionCall.php @@ -57,7 +57,7 @@ class FunctionCall extends Component * * @return FunctionCall */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -112,7 +112,7 @@ class FunctionCall extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { return $component->name . $component->parameters; } diff --git a/src/Components/GroupKeyword.php b/src/Components/GroupKeyword.php index 9aa583d..a2006a7 100644 --- a/src/Components/GroupKeyword.php +++ b/src/Components/GroupKeyword.php @@ -44,9 +44,9 @@ class GroupKeyword extends Component * * @return GroupKeyword[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -120,7 +120,7 @@ class GroupKeyword extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(', ', $component); diff --git a/src/Components/IndexHint.php b/src/Components/IndexHint.php index a0cb0f1..9284945 100644 --- a/src/Components/IndexHint.php +++ b/src/Components/IndexHint.php @@ -46,7 +46,7 @@ class IndexHint extends Component * * @var array */ - public $indexes = []; + public $indexes = array(); /** * Constructor. @@ -56,7 +56,7 @@ class IndexHint extends Component * @param string $for the clause for which this hint is (JOIN/ORDER BY/GROUP BY) * @param string $indexes List of indexes in this hint */ - public function __construct(string $type = null, string $indexOrKey = null, string $for = null, array $indexes = []) + public function __construct(string $type = null, string $indexOrKey = null, string $for = null, array $indexes = array()) { $this->type = $type; $this->indexOrKey = $indexOrKey; @@ -71,9 +71,9 @@ class IndexHint extends Component * * @return IndexHint|Component[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); $expr->type = isset($options['type']) ? $options['type'] : null; /** @@ -178,7 +178,7 @@ class IndexHint extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(' ', $component); diff --git a/src/Components/IntoKeyword.php b/src/Components/IntoKeyword.php index 1941c22..79c3f3f 100644 --- a/src/Components/IntoKeyword.php +++ b/src/Components/IntoKeyword.php @@ -143,7 +143,7 @@ class IntoKeyword extends Component * * @return IntoKeyword */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -269,7 +269,7 @@ class IntoKeyword extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if ($component->dest instanceof Expression) { $columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : ''; diff --git a/src/Components/JoinKeyword.php b/src/Components/JoinKeyword.php index 330c1f2..9da28e0 100644 --- a/src/Components/JoinKeyword.php +++ b/src/Components/JoinKeyword.php @@ -98,9 +98,9 @@ class JoinKeyword extends Component * * @return JoinKeyword[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -212,9 +212,9 @@ class JoinKeyword extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { - $ret = []; + $ret = array(); foreach ($component as $c) { $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr . (! empty($c->on) diff --git a/src/Components/Key.php b/src/Components/Key.php index 37e51a4..e72300f 100644 --- a/src/Components/Key.php +++ b/src/Components/Key.php @@ -85,7 +85,7 @@ class Key extends Component */ public function __construct( $name = null, - array $columns = [], + array $columns = array(), $type = null, $options = null ) { @@ -102,7 +102,7 @@ class Key extends Component * * @return Key */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -111,7 +111,7 @@ class Key extends Component * * @var array */ - $lastColumn = []; + $lastColumn = array(); /** * The state of the parser. @@ -164,7 +164,7 @@ class Key extends Component $state = ($token->value === ',') ? 2 : 4; if (! empty($lastColumn)) { $ret->columns[] = $lastColumn; - $lastColumn = []; + $lastColumn = array(); } } } else { @@ -194,14 +194,14 @@ class Key extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { $ret = $component->type . ' '; if (! empty($component->name)) { $ret .= Context::escape($component->name) . ' '; } - $columns = []; + $columns = array(); foreach ($component->columns as $column) { $tmp = Context::escape($column['name']); if (isset($column['length'])) { diff --git a/src/Components/Limit.php b/src/Components/Limit.php index edb25fb..85412fd 100644 --- a/src/Components/Limit.php +++ b/src/Components/Limit.php @@ -53,7 +53,7 @@ class Limit extends Component * * @return Limit */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -121,7 +121,7 @@ class Limit extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { return $component->offset . ', ' . $component->rowCount; } diff --git a/src/Components/LockExpression.php b/src/Components/LockExpression.php index 8bf03ce..c1ee848 100644 --- a/src/Components/LockExpression.php +++ b/src/Components/LockExpression.php @@ -41,7 +41,7 @@ class LockExpression extends Component * * @return CaseExpression */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -103,7 +103,7 @@ class LockExpression extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(', ', $component); diff --git a/src/Components/OptionsArray.php b/src/Components/OptionsArray.php index f872b14..40b07a3 100644 --- a/src/Components/OptionsArray.php +++ b/src/Components/OptionsArray.php @@ -26,7 +26,7 @@ class OptionsArray extends Component * * @var array */ - public $options = []; + public $options = array(); /** * Constructor. @@ -35,7 +35,7 @@ class OptionsArray extends Component * must be an array with at least two keys `name` and * `expr` or `value`. */ - public function __construct(array $options = []) + public function __construct(array $options = array()) { $this->options = $options; } @@ -47,7 +47,7 @@ class OptionsArray extends Component * * @return OptionsArray */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -276,13 +276,13 @@ class OptionsArray extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (empty($component->options)) { return ''; } - $options = []; + $options = array(); foreach ($component->options as $option) { if (! is_array($option)) { $options[] = $option; diff --git a/src/Components/OrderKeyword.php b/src/Components/OrderKeyword.php index 820fdd1..81a408c 100644 --- a/src/Components/OrderKeyword.php +++ b/src/Components/OrderKeyword.php @@ -53,9 +53,9 @@ class OrderKeyword extends Component * * @return OrderKeyword[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -129,7 +129,7 @@ class OrderKeyword extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(', ', $component); diff --git a/src/Components/ParameterDefinition.php b/src/Components/ParameterDefinition.php index d4165ee..4cd5023 100644 --- a/src/Components/ParameterDefinition.php +++ b/src/Components/ParameterDefinition.php @@ -63,9 +63,9 @@ class ParameterDefinition extends Component * * @return ParameterDefinition[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -153,7 +153,7 @@ class ParameterDefinition extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return '(' . implode(', ', $component) . ')'; diff --git a/src/Components/PartitionDefinition.php b/src/Components/PartitionDefinition.php index 58223ea..b07317a 100644 --- a/src/Components/PartitionDefinition.php +++ b/src/Components/PartitionDefinition.php @@ -117,7 +117,7 @@ class PartitionDefinition extends Component * * @return PartitionDefinition */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -226,7 +226,7 @@ class PartitionDefinition extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return "(\n" . implode(",\n", $component) . "\n)"; diff --git a/src/Components/Reference.php b/src/Components/Reference.php index 4077f77..3cec28f 100644 --- a/src/Components/Reference.php +++ b/src/Components/Reference.php @@ -69,7 +69,7 @@ class Reference extends Component * @param array $columns the columns referenced * @param OptionsArray $options the options */ - public function __construct($table = null, array $columns = [], $options = null) + public function __construct($table = null, array $columns = array(), $options = null) { $this->table = $table; $this->columns = $columns; @@ -83,7 +83,7 @@ class Reference extends Component * * @return Reference */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { $ret = new self(); @@ -151,7 +151,7 @@ class Reference extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { return trim( $component->table diff --git a/src/Components/RenameOperation.php b/src/Components/RenameOperation.php index d11a187..169d6f7 100644 --- a/src/Components/RenameOperation.php +++ b/src/Components/RenameOperation.php @@ -53,9 +53,9 @@ class RenameOperation extends Component * * @return RenameOperation[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -171,7 +171,7 @@ class RenameOperation extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(', ', $component); diff --git a/src/Components/SetOperation.php b/src/Components/SetOperation.php index 4c8ced3..a4a55cc 100644 --- a/src/Components/SetOperation.php +++ b/src/Components/SetOperation.php @@ -53,9 +53,9 @@ class SetOperation extends Component * * @return SetOperation[] */ - public static function parse(Parser $parser, TokensList $list, array $options = []) + public static function parse(Parser $parser, TokensList $list, array $options = array()) { - $ret = []; + $ret = array(); $expr = new self(); @@ -150,7 +150,7 @@ class SetOperation extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { if (is_array($component)) { return implode(', ', $component); diff --git a/src/Components/UnionKeyword.php b/src/Components/UnionKeyword.php index dc06831..e3768bc 100644 --- a/src/Components/UnionKeyword.php +++ b/src/Components/UnionKeyword.php @@ -23,9 +23,9 @@ class UnionKeyword extends Component * * @return string */ - public static function build($component, array $options = []) + public static function build($component, array $options = array()) { - $tmp = []; + $tmp = array(); foreach ($component as $componentPart) { $tmp[] = $componentPart[0] . ' ' . $componentPart[1]; } diff --git a/src/Context.php b/src/Context.php index c9ff19e..9bfba17 100644 --- a/src/Context.php +++ b/src/Context.php @@ -86,7 +86,7 @@ abstract class Context * * @var array */ - public static $KEYWORDS = []; + public static $KEYWORDS = array(); /** * List of operators and their flags. diff --git a/src/Core.php b/src/Core.php index 1965a2f..a55dd18 100644 --- a/src/Core.php +++ b/src/Core.php @@ -28,7 +28,7 @@ class Core * * @see Core::error() */ - public $errors = []; + public $errors = array(); /** * Creates a new error log. diff --git a/src/Parser.php b/src/Parser.php index 91524fd..f38914f 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -346,7 +346,7 @@ class Parser extends Core * * @var Statement[] */ - public $statements = []; + public $statements = array(); /** * The number of opened brackets. @@ -535,7 +535,7 @@ class Parser extends Core // `LIMIT` keywords actually belong to the first statement. $lastStatement->order = $statement->order; $lastStatement->limit = $statement->limit; - $statement->order = []; + $statement->order = array(); $statement->limit = null; // The statement actually ends where the last statement in diff --git a/src/Statement.php b/src/Statement.php index de94951..301fd24 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -40,7 +40,7 @@ abstract class Statement * * @var array */ - public static $OPTIONS = []; + public static $OPTIONS = array(); /** * The clauses of this statement, in order. @@ -54,9 +54,9 @@ abstract class Statement * * @var array */ - public static $CLAUSES = []; + public static $CLAUSES = array(); - public static $END_OPTIONS = []; + public static $END_OPTIONS = array(); /** * The options of this query. @@ -120,7 +120,7 @@ abstract class Statement * * @var array */ - $built = []; + $built = array(); /** * Statement's clauses. @@ -202,7 +202,7 @@ abstract class Statement * * @var array */ - $parsedClauses = []; + $parsedClauses = array(); // This may be corrected by the parser. $this->first = $list->idx; @@ -303,7 +303,7 @@ abstract class Statement * * @var array */ - $options = []; + $options = array(); // Looking for duplicated clauses. if (! empty(Parser::$KEYWORD_PARSERS[$token->value]) diff --git a/src/Statements/AlterStatement.php b/src/Statements/AlterStatement.php index 0620936..0991532 100644 --- a/src/Statements/AlterStatement.php +++ b/src/Statements/AlterStatement.php @@ -35,7 +35,7 @@ class AlterStatement extends Statement * * @var AlterOperation[] */ - public $altered = []; + public $altered = array(); /** * Options of this statement. @@ -114,7 +114,7 @@ class AlterStatement extends Statement } if ($state === 0) { - $options = []; + $options = array(); if ($this->options->has('DATABASE')) { $options = AlterOperation::$DB_OPTIONS; } elseif ($this->options->has('TABLE')) { @@ -138,7 +138,7 @@ class AlterStatement extends Statement */ public function build() { - $tmp = []; + $tmp = array(); foreach ($this->altered as $altered) { $tmp[] = $altered::build($altered); } diff --git a/src/Statements/CreateStatement.php b/src/Statements/CreateStatement.php index ffa08bc..3d019ef 100644 --- a/src/Statements/CreateStatement.php +++ b/src/Statements/CreateStatement.php @@ -367,7 +367,7 @@ class CreateStatement extends Statement * * @var Token[]|string */ - public $body = []; + public $body = array(); /** * @return string diff --git a/src/Statements/LockStatement.php b/src/Statements/LockStatement.php index 0166dca..19e6eb4 100644 --- a/src/Statements/LockStatement.php +++ b/src/Statements/LockStatement.php @@ -26,7 +26,7 @@ class LockStatement extends Statement * * @var LockExpression[] */ - public $locked = []; + public $locked = array(); /** * Whether it's a LOCK statement diff --git a/src/Statements/NotImplementedStatement.php b/src/Statements/NotImplementedStatement.php index 254ca15..67c1bea 100644 --- a/src/Statements/NotImplementedStatement.php +++ b/src/Statements/NotImplementedStatement.php @@ -27,7 +27,7 @@ class NotImplementedStatement extends Statement * * @var Token[] */ - public $unknown = []; + public $unknown = array(); /** * @return string diff --git a/src/Statements/SelectStatement.php b/src/Statements/SelectStatement.php index a770227..a206b54 100644 --- a/src/Statements/SelectStatement.php +++ b/src/Statements/SelectStatement.php @@ -226,14 +226,14 @@ class SelectStatement extends Statement * * @var Expression[] */ - public $expr = []; + public $expr = array(); /** * Tables used as sources for this statement. * * @var Expression[] */ - public $from = []; + public $from = array(); /** * Index hints @@ -310,7 +310,7 @@ class SelectStatement extends Statement * * @var SelectStatement[] */ - public $union = []; + public $union = array(); /** * The end options of this query. diff --git a/src/TokensList.php b/src/TokensList.php index 507d68b..32b4819 100644 --- a/src/TokensList.php +++ b/src/TokensList.php @@ -20,7 +20,7 @@ class TokensList implements \ArrayAccess * * @var array */ - public $tokens = []; + public $tokens = array(); /** * The count of tokens. @@ -42,7 +42,7 @@ class TokensList implements \ArrayAccess * @param array $tokens the initial array of tokens * @param int $count the count of tokens in the initial array */ - public function __construct(array $tokens = [], $count = -1) + public function __construct(array $tokens = array(), $count = -1) { if (! empty($tokens)) { $this->tokens = $tokens; diff --git a/src/Utils/BufferedQuery.php b/src/Utils/BufferedQuery.php index c2dd074..02c55c1 100644 --- a/src/Utils/BufferedQuery.php +++ b/src/Utils/BufferedQuery.php @@ -49,7 +49,7 @@ class BufferedQuery * * @var array */ - public $options = []; + public $options = array(); /** * The last delimiter used. @@ -85,7 +85,7 @@ class BufferedQuery * @param string $query the query to be parsed * @param array $options the options of this parser */ - public function __construct($query = '', array $options = []) + public function __construct($query = '', array $options = array()) { // Merges specified options with defaults. $this->options = array_merge( diff --git a/src/Utils/Error.php b/src/Utils/Error.php index d0f82ed..49d634c 100644 --- a/src/Utils/Error.php +++ b/src/Utils/Error.php @@ -32,7 +32,7 @@ class Error */ public static function get($objs) { - $ret = []; + $ret = array(); foreach ($objs as $obj) { if ($obj instanceof Lexer) { @@ -77,7 +77,7 @@ class Error $errors, $format = '#%1$d: %2$s (near "%4$s" at position %5$d)' ) { - $ret = []; + $ret = array(); $i = 0; foreach ($errors as $key => $err) { diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index 3b17a2b..0867c48 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -74,7 +74,7 @@ class Formatter * * @param array $options the formatting options */ - public function __construct(array $options = []) + public function __construct(array $options = array()) { $this->options = $this->getMergedOptions($options); } @@ -244,7 +244,7 @@ class Formatter private static function mergeFormats(array $formats, array $newFormats) { - $added = []; + $added = array(); $integers = [ 'flags', 'type', @@ -341,7 +341,7 @@ class Formatter * * @var array */ - $blocksIndentation = []; + $blocksIndentation = array(); /** * A stack that keeps track of the line endings every time a new block @@ -349,7 +349,7 @@ class Formatter * * @var array */ - $blocksLineEndings = []; + $blocksLineEndings = array(); /** * Whether clause's options were formatted. @@ -663,7 +663,7 @@ class Formatter * * @return string the formatted string */ - public static function format($query, array $options = []) + public static function format($query, array $options = array()) { $lexer = new Lexer($query); $formatter = new self($options); diff --git a/src/Utils/Misc.php b/src/Utils/Misc.php index 9e3ae02..ad81c8b 100644 --- a/src/Utils/Misc.php +++ b/src/Utils/Misc.php @@ -32,12 +32,12 @@ class Misc || empty($statement->expr) || empty($statement->from) ) { - return []; + return array(); } - $retval = []; + $retval = array(); - $tables = []; + $tables = array(); /** * Expressions that may contain aliases. @@ -78,7 +78,7 @@ class Misc } if (! isset($tables[$thisDb])) { - $tables[$thisDb] = []; + $tables[$thisDb] = array(); } $tables[$thisDb][$expr->alias] = $expr->table; } diff --git a/src/Utils/Query.php b/src/Utils/Query.php index 7b14ded..861e690 100644 --- a/src/Utils/Query.php +++ b/src/Utils/Query.php @@ -416,11 +416,11 @@ class Query $ret['statement'] = $statement; if ($statement instanceof SelectStatement) { - $ret['select_tables'] = []; - $ret['select_expr'] = []; + $ret['select_tables'] = array(); + $ret['select_expr'] = array(); // Finding tables' aliases and their associated real names. - $tableAliases = []; + $tableAliases = array(); foreach ($statement->from as $expr) { if (isset($expr->table, $expr->alias) && ($expr->table !== '') && ($expr->alias !== '') ) { @@ -484,7 +484,7 @@ class Query */ public static function getTables($statement) { - $expressions = []; + $expressions = array(); if (($statement instanceof InsertStatement) || ($statement instanceof ReplaceStatement) @@ -503,7 +503,7 @@ class Query } elseif ($statement instanceof DropStatement) { if (! $statement->options->has('TABLE')) { // No tables are dropped. - return []; + return array(); } $expressions = $statement->fields; } elseif ($statement instanceof RenameStatement) { @@ -512,7 +512,7 @@ class Query } } - $ret = []; + $ret = array(); foreach ($expressions as $expr) { if (! empty($expr->table)) { $expr->expr = null; // Force rebuild. diff --git a/src/Utils/Routine.php b/src/Utils/Routine.php index 9842ff1..1faa028 100644 --- a/src/Utils/Routine.php +++ b/src/Utils/Routine.php @@ -45,7 +45,7 @@ class Routine ]; } - $options = []; + $options = array(); foreach ($type->options->options as $opt) { $options[] = is_string($opt) ? $opt : $opt['value']; } @@ -85,7 +85,7 @@ class Routine $param = $param[0]; - $options = []; + $options = array(); foreach ($param->type->options->options as $opt) { $options[] = is_string($opt) ? $opt : $opt['value']; } @@ -126,7 +126,7 @@ class Routine $retval['type'][$idx] = $param->type->name; $retval['length'][$idx] = implode(',', $param->type->parameters); $retval['length_arr'][$idx] = $param->type->parameters; - $retval['opts'][$idx] = []; + $retval['opts'][$idx] = array(); foreach ($param->type->options->options as $opt) { $retval['opts'][$idx][] = is_string($opt) ? $opt : $opt['value']; diff --git a/src/Utils/Table.php b/src/Utils/Table.php index 140ed2a..5f706a0 100644 --- a/src/Utils/Table.php +++ b/src/Utils/Table.php @@ -30,17 +30,17 @@ class Table || (! is_array($statement->fields)) || (! $statement->options->has('TABLE')) ) { - return []; + return array(); } - $ret = []; + $ret = array(); foreach ($statement->fields as $field) { if (empty($field->key) || ($field->key->type !== 'FOREIGN KEY')) { continue; } - $columns = []; + $columns = array(); foreach ($field->key->columns as $column) { $columns[] = $column['name']; } @@ -87,10 +87,10 @@ class Table || (! is_array($statement->fields)) || (! $statement->options->has('TABLE')) ) { - return []; + return array(); } - $ret = []; + $ret = array(); foreach ($statement->fields as $field) { // Skipping keys. diff --git a/src/Utils/Tokens.php b/src/Utils/Tokens.php index b7f5935..7249ca0 100644 --- a/src/Utils/Tokens.php +++ b/src/Utils/Tokens.php @@ -85,7 +85,7 @@ class Tokens * * @var array */ - $newList = []; + $newList = array(); /** * The length of the find pattern is calculated only once. |