diff options
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | bin/highlight-query | 4 | ||||
-rwxr-xr-x | bin/lint-query | 4 | ||||
-rwxr-xr-x | bin/tokenize-query | 4 | ||||
-rw-r--r-- | src/Components/ArrayObj.php | 10 | ||||
-rw-r--r-- | src/Components/CreateDefinition.php | 2 | ||||
-rw-r--r-- | src/Statements/SelectStatement.php | 4 | ||||
-rw-r--r-- | src/Utils/Error.php | 2 | ||||
-rw-r--r-- | src/Utils/Formatter.php | 2 | ||||
-rw-r--r-- | src/Utils/Query.php | 2 | ||||
-rw-r--r-- | tests/Components/ExpressionTest.php | 4 | ||||
-rw-r--r-- | tests/Utils/FormatterTest.php | 2 | ||||
-rw-r--r-- | tools/sami-config.php | 4 |
13 files changed, 23 insertions, 23 deletions
@@ -56,7 +56,7 @@ cat example.sql | ./vendor/bin/lint-query ### Formatting SQL query ```php -echo PhpMyAdmin\SqlParser\Utils\Formatter::format($query, array('type' => 'html')); +echo PhpMyAdmin\SqlParser\Utils\Formatter::format($query, ['type' => 'html']); ``` ### Discoverying query type diff --git a/bin/highlight-query b/bin/highlight-query index a25a3e2..53d380f 100755 --- a/bin/highlight-query +++ b/bin/highlight-query @@ -2,12 +2,12 @@ <?php declare(strict_types=1); -$files = array( +$files = [ __DIR__ . "/../vendor/autoload.php", __DIR__ . "/../../vendor/autoload.php", __DIR__ . "/../../../autoload.php", "vendor/autoload.php" -); +]; $found = false; foreach ($files as $file) { diff --git a/bin/lint-query b/bin/lint-query index 8d7cd29..1fe12f2 100755 --- a/bin/lint-query +++ b/bin/lint-query @@ -2,12 +2,12 @@ <?php declare(strict_types=1); -$files = array( +$files = [ __DIR__ . "/../vendor/autoload.php", __DIR__ . "/../../vendor/autoload.php", __DIR__ . "/../../../autoload.php", "vendor/autoload.php" -); +]; $found = false; foreach ($files as $file) { diff --git a/bin/tokenize-query b/bin/tokenize-query index 97012c7..e1a55f6 100755 --- a/bin/tokenize-query +++ b/bin/tokenize-query @@ -2,12 +2,12 @@ <?php declare(strict_types=1); -$files = array( +$files = [ __DIR__ . "/../vendor/autoload.php", __DIR__ . "/../../vendor/autoload.php", __DIR__ . "/../../../autoload.php", "vendor/autoload.php" -); +]; $found = false; foreach ($files as $file) { diff --git a/src/Components/ArrayObj.php b/src/Components/ArrayObj.php index 1166a9b..ab1ad61 100644 --- a/src/Components/ArrayObj.php +++ b/src/Components/ArrayObj.php @@ -147,11 +147,11 @@ class ArrayObj extends Component // // This is treated differently to treat the following cases: // - // => array() - // (,) => array('', '') - // () => array() - // (a,) => array('a', '') - // (a) => array('a') + // => [] + // [,] => ['', ''] + // [] => [] + // [a,] => ['a', ''] + // [a] => ['a'] $lastRaw = trim($lastRaw); if (empty($options['type']) && ((strlen($lastRaw) > 0) || ($isCommaLast)) diff --git a/src/Components/CreateDefinition.php b/src/Components/CreateDefinition.php index 243729d..0cd29c9 100644 --- a/src/Components/CreateDefinition.php +++ b/src/Components/CreateDefinition.php @@ -90,7 +90,7 @@ class CreateDefinition extends Component // // 'UNIQUE' => 4, // 'UNIQUE KEY' => 4, - // 'COMMENT' => array(5, 'var'), + // 'COMMENT' => [5, 'var'], // 'NOT NULL' => 1, // 'NULL' => 1, // 'PRIMARY' => 4, diff --git a/src/Statements/SelectStatement.php b/src/Statements/SelectStatement.php index 97e8fba..4fecd90 100644 --- a/src/Statements/SelectStatement.php +++ b/src/Statements/SelectStatement.php @@ -213,8 +213,8 @@ class SelectStatement extends Statement 1, ], // These are available only when `UNION` is present. - // 'ORDER BY' => array('ORDER BY', 3), - // 'LIMIT' => array('LIMIT', 3), + // 'ORDER BY' => ['ORDER BY', 3], + // 'LIMIT' => ['LIMIT', 3], ]; /** diff --git a/src/Utils/Error.php b/src/Utils/Error.php index 484da5c..789da0e 100644 --- a/src/Utils/Error.php +++ b/src/Utils/Error.php @@ -26,7 +26,7 @@ class Error * `$err[1]` holds the error code. * `$err[2]` holds the string that caused the issue. * `$err[3]` holds the position of the string. - * (i.e. `array($msg, $code, $str, $pos)`) + * (i.e. `[$msg, $code, $str, $pos]`) */ public static function get($objs) { diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index 6d340cc..017d5b1 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -170,7 +170,7 @@ class Formatter /** * The styles used for HTML formatting. - * array($type, $flags, $span, $callback). + * [$type, $flags, $span, $callback]. * * @return array */ diff --git a/src/Utils/Query.php b/src/Utils/Query.php index 43da834..e16d172 100644 --- a/src/Utils/Query.php +++ b/src/Utils/Query.php @@ -694,7 +694,7 @@ class Query * @param Statement $statement the parsed query that has to be modified * @param TokensList $list the list of tokens * @param array $ops Clauses to be replaced. Contains multiple - * arrays having two values: array($old, $new). + * arrays having two values: [$old, $new]. * Clauses must be sorted. * * @return string diff --git a/tests/Components/ExpressionTest.php b/tests/Components/ExpressionTest.php index f56384c..8e51e01 100644 --- a/tests/Components/ExpressionTest.php +++ b/tests/Components/ExpressionTest.php @@ -39,10 +39,10 @@ class ExpressionTest extends TestCase { return [ /* - array( + [ '(1))', 'Unexpected closing bracket.', - ), + ], */ [ 'tbl..col', diff --git a/tests/Utils/FormatterTest.php b/tests/Utils/FormatterTest.php index f3c6422..9f5fbb5 100644 --- a/tests/Utils/FormatterTest.php +++ b/tests/Utils/FormatterTest.php @@ -59,7 +59,7 @@ class FormatterTest extends TestCase public function mergeFormats() { - // array($default[], $overriding[], $expected[]) + // [default[], overriding[], expected[]] return [ 'empty formats' => [ 'default' => [ diff --git a/tools/sami-config.php b/tools/sami-config.php index 39db4ed..f8dad47 100644 --- a/tools/sami-config.php +++ b/tools/sami-config.php @@ -14,9 +14,9 @@ $iterator = Finder::create() ->in("./src") ; -return new Sami($iterator, array( +return new Sami($iterator, [ "title" => "A validating SQL lexer and parser with a focus on MySQL dialect.", "build_dir" => "./doc/", "cache_dir" => "./tmp" -)); +]); |