summaryrefslogtreecommitdiffstats
path: root/src/Components/IntoKeyword.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Components/IntoKeyword.php')
-rw-r--r--src/Components/IntoKeyword.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/Components/IntoKeyword.php b/src/Components/IntoKeyword.php
index a31f6a0..cebfa7a 100644
--- a/src/Components/IntoKeyword.php
+++ b/src/Components/IntoKeyword.php
@@ -1,8 +1,8 @@
<?php
-
/**
* `INTO` keyword parser.
*/
+declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Components;
@@ -25,37 +25,37 @@ class IntoKeyword extends Component
*
* @var array
*/
- public static $FIELDS_OPTIONS = array(
- 'TERMINATED BY' => array(
+ public static $FIELDS_OPTIONS = [
+ 'TERMINATED BY' => [
1,
'expr',
- ),
+ ],
'OPTIONALLY' => 2,
- 'ENCLOSED BY' => array(
+ 'ENCLOSED BY' => [
3,
'expr',
- ),
- 'ESCAPED BY' => array(
+ ],
+ 'ESCAPED BY' => [
4,
'expr',
- )
- );
+ ],
+ ];
/**
* LINES Options for `SELECT...INTO` statements.
*
* @var array
*/
- public static $LINES_OPTIONS = array(
- 'STARTING BY' => array(
+ public static $LINES_OPTIONS = [
+ 'STARTING BY' => [
1,
'expr',
- ),
- 'TERMINATED BY' => array(
+ ],
+ 'TERMINATED BY' => [
2,
'expr',
- )
- );
+ ],
+ ];
/**
* Type of target (OUTFILE or SYMBOL).
@@ -143,9 +143,9 @@ class IntoKeyword extends Component
*
* @return IntoKeyword
*/
- 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.
@@ -203,10 +203,10 @@ class IntoKeyword extends Component
$ret->dest = Expression::parse(
$parser,
$list,
- array(
+ [
'parseField' => 'table',
- 'breakOnAlias' => true
- )
+ 'breakOnAlias' => true,
+ ]
);
} else {
$ret->values = ExpressionArray::parse($parser, $list);
@@ -269,7 +269,7 @@ class IntoKeyword extends Component
*
* @return string
*/
- public static function build($component, array $options = array())
+ public static function build($component, array $options = [])
{
if ($component->dest instanceof Expression) {
$columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : '';
@@ -287,7 +287,7 @@ class IntoKeyword extends Component
$ret .= ' ' . $fields_options_str;
}
- $lines_options_str = OptionsArray::build($component->lines_options, array('expr' => true));
+ $lines_options_str = OptionsArray::build($component->lines_options, ['expr' => true]);
if (trim($lines_options_str) !== '') {
$ret .= ' LINES ' . $lines_options_str;
}