Skip to content

Commit 32e2949

Browse files
committed
Remove left overs of old array syntax
Signed-off-by: William Desportes <[email protected]>
1 parent 9ed9cc3 commit 32e2949

File tree

13 files changed

+23
-23
lines changed

13 files changed

+23
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ cat example.sql | ./vendor/bin/lint-query
5656
### Formatting SQL query
5757

5858
```php
59-
echo PhpMyAdmin\SqlParser\Utils\Formatter::format($query, array('type' => 'html'));
59+
echo PhpMyAdmin\SqlParser\Utils\Formatter::format($query, ['type' => 'html']);
6060
```
6161

6262
### Discoverying query type

bin/highlight-query

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<?php
33
declare(strict_types=1);
44

5-
$files = array(
5+
$files = [
66
__DIR__ . "/../vendor/autoload.php",
77
__DIR__ . "/../../vendor/autoload.php",
88
__DIR__ . "/../../../autoload.php",
99
"vendor/autoload.php"
10-
);
10+
];
1111

1212
$found = false;
1313
foreach ($files as $file) {

bin/lint-query

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<?php
33
declare(strict_types=1);
44

5-
$files = array(
5+
$files = [
66
__DIR__ . "/../vendor/autoload.php",
77
__DIR__ . "/../../vendor/autoload.php",
88
__DIR__ . "/../../../autoload.php",
99
"vendor/autoload.php"
10-
);
10+
];
1111

1212
$found = false;
1313
foreach ($files as $file) {

bin/tokenize-query

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<?php
33
declare(strict_types=1);
44

5-
$files = array(
5+
$files = [
66
__DIR__ . "/../vendor/autoload.php",
77
__DIR__ . "/../../vendor/autoload.php",
88
__DIR__ . "/../../../autoload.php",
99
"vendor/autoload.php"
10-
);
10+
];
1111

1212
$found = false;
1313
foreach ($files as $file) {

src/Components/ArrayObj.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ public static function parse(Parser $parser, TokensList $list, array $options =
147147
//
148148
// This is treated differently to treat the following cases:
149149
//
150-
// => array()
151-
// (,) => array('', '')
152-
// () => array()
153-
// (a,) => array('a', '')
154-
// (a) => array('a')
150+
// => []
151+
// [,] => ['', '']
152+
// [] => []
153+
// [a,] => ['a', '']
154+
// [a] => ['a']
155155
$lastRaw = trim($lastRaw);
156156
if (empty($options['type'])
157157
&& ((strlen($lastRaw) > 0) || ($isCommaLast))

src/Components/CreateDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class CreateDefinition extends Component
9090
//
9191
// 'UNIQUE' => 4,
9292
// 'UNIQUE KEY' => 4,
93-
// 'COMMENT' => array(5, 'var'),
93+
// 'COMMENT' => [5, 'var'],
9494
// 'NOT NULL' => 1,
9595
// 'NULL' => 1,
9696
// 'PRIMARY' => 4,

src/Statements/SelectStatement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ class SelectStatement extends Statement
213213
1,
214214
],
215215
// These are available only when `UNION` is present.
216-
// 'ORDER BY' => array('ORDER BY', 3),
217-
// 'LIMIT' => array('LIMIT', 3),
216+
// 'ORDER BY' => ['ORDER BY', 3],
217+
// 'LIMIT' => ['LIMIT', 3],
218218
];
219219

220220
/**

src/Utils/Error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Error
2626
* `$err[1]` holds the error code.
2727
* `$err[2]` holds the string that caused the issue.
2828
* `$err[3]` holds the position of the string.
29-
* (i.e. `array($msg, $code, $str, $pos)`)
29+
* (i.e. `[$msg, $code, $str, $pos]`)
3030
*/
3131
public static function get($objs)
3232
{

src/Utils/Formatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ protected function getDefaultOptions()
170170

171171
/**
172172
* The styles used for HTML formatting.
173-
* array($type, $flags, $span, $callback).
173+
* [$type, $flags, $span, $callback].
174174
*
175175
* @return array
176176
*/

src/Utils/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ public static function replaceClause($statement, $list, $old, $new = null, $only
694694
* @param Statement $statement the parsed query that has to be modified
695695
* @param TokensList $list the list of tokens
696696
* @param array $ops Clauses to be replaced. Contains multiple
697-
* arrays having two values: array($old, $new).
697+
* arrays having two values: [$old, $new].
698698
* Clauses must be sorted.
699699
*
700700
* @return string

tests/Components/ExpressionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public function parseErrProvider()
3939
{
4040
return [
4141
/*
42-
array(
42+
[
4343
'(1))',
4444
'Unexpected closing bracket.',
45-
),
45+
],
4646
*/
4747
[
4848
'tbl..col',

tests/Utils/FormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testMergeFormats($default, $overriding, $expected)
5959

6060
public function mergeFormats()
6161
{
62-
// array($default[], $overriding[], $expected[])
62+
// [default[], overriding[], expected[]]
6363
return [
6464
'empty formats' => [
6565
'default' => [

tools/sami-config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
->in("./src")
1515
;
1616

17-
return new Sami($iterator, array(
17+
return new Sami($iterator, [
1818
"title" => "A validating SQL lexer and parser with a focus on MySQL dialect.",
1919
"build_dir" => "./doc/",
2020
"cache_dir" => "./tmp"
21-
));
21+
]);
2222

0 commit comments

Comments
 (0)