summaryrefslogtreecommitdiffstats
path: root/src/Statements/AlterStatement.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Statements/AlterStatement.php')
-rw-r--r--src/Statements/AlterStatement.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/Statements/AlterStatement.php b/src/Statements/AlterStatement.php
index ce0c824..a03b2fc 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;
@@ -16,10 +16,6 @@ use PhpMyAdmin\SqlParser\TokensList;
/**
* `ALTER` statement.
- *
- * @category Statements
- *
- * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
*/
class AlterStatement extends Statement
{
@@ -35,14 +31,14 @@ class AlterStatement extends Statement
*
* @var AlterOperation[]
*/
- public $altered = array();
+ public $altered = [];
/**
* Options of this statement.
*
* @var array
*/
- public static $OPTIONS = array(
+ public static $OPTIONS = [
'ONLINE' => 1,
'OFFLINE' => 1,
'IGNORE' => 2,
@@ -54,8 +50,8 @@ class AlterStatement extends Statement
'SERVER' => 3,
'TABLE' => 3,
'TABLESPACE' => 3,
- 'VIEW' => 3
- );
+ 'VIEW' => 3,
+ ];
/**
* @param Parser $parser the instance that requests parsing
@@ -75,10 +71,10 @@ class AlterStatement extends Statement
$this->table = Expression::parse(
$parser,
$list,
- array(
+ [
'parseField' => 'table',
- 'breakOnAlias' => true
- )
+ 'breakOnAlias' => true,
+ ]
);
++$list->idx; // Skipping field.
@@ -114,7 +110,7 @@ class AlterStatement extends Statement
}
if ($state === 0) {
- $options = array();
+ $options = [];
if ($this->options->has('DATABASE')) {
$options = AlterOperation::$DB_OPTIONS;
} elseif ($this->options->has('TABLE')) {
@@ -138,7 +134,7 @@ class AlterStatement extends Statement
*/
public function build()
{
- $tmp = array();
+ $tmp = [];
foreach ($this->altered as $altered) {
$tmp[] = $altered::build($altered);
}