summaryrefslogtreecommitdiffstats
path: root/src/Components/Reference.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Components/Reference.php')
-rw-r--r--src/Components/Reference.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Components/Reference.php b/src/Components/Reference.php
index 38fc060..aac73ac 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;
@@ -26,20 +26,20 @@ class Reference extends Component
*
* @var array
*/
- public static $REFERENCES_OPTIONS = array(
- 'MATCH' => array(
+ public static $REFERENCES_OPTIONS = [
+ 'MATCH' => [
1,
'var',
- ),
- 'ON DELETE' => array(
+ ],
+ 'ON DELETE' => [
2,
'var',
- ),
- 'ON UPDATE' => array(
+ ],
+ 'ON UPDATE' => [
3,
'var',
- )
- );
+ ],
+ ];
/**
* The referenced table.
@@ -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 = array(), $options = null)
+ public function __construct($table = null, array $columns = [], $options = null)
{
$this->table = $table;
$this->columns = $columns;
@@ -83,9 +83,9 @@ class Reference extends Component
*
* @return Reference
*/
- public static function parse(Parser $parser, TokensList $list, array $options = array())
+ public static function parse(Parser $parser, TokensList $list, array $options = [])
{
- $ret = new self();
+ $ret = new static();
/**
* The state of the parser.
@@ -124,10 +124,10 @@ class Reference extends Component
$ret->table = Expression::parse(
$parser,
$list,
- array(
+ [
'parseField' => 'table',
- 'breakOnAlias' => true
- )
+ 'breakOnAlias' => true,
+ ]
);
$state = 1;
} elseif ($state === 1) {
@@ -151,7 +151,7 @@ class Reference extends Component
*
* @return string
*/
- public static function build($component, array $options = array())
+ public static function build($component, array $options = [])
{
return trim(
$component->table