diff options
author | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2019-01-08 21:32:02 -0200 |
---|---|---|
committer | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2019-01-16 17:21:25 -0200 |
commit | 86c5baebda24c1721fb6881df8671a3c7df60e8b (patch) | |
tree | 0a76d58ea229d1008e169b1c5b25ce90dde91808 /src/Components/IntoKeyword.php | |
parent | 28427543566b6dd32fe44db704ea41368ba55c0e (diff) | |
download | sql-parser-86c5baebda24c1721fb6881df8671a3c7df60e8b.zip sql-parser-86c5baebda24c1721fb6881df8671a3c7df60e8b.tar.gz sql-parser-86c5baebda24c1721fb6881df8671a3c7df60e8b.tar.bz2 |
Apply phpmyadmin/coding-standard
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'src/Components/IntoKeyword.php')
-rw-r--r-- | src/Components/IntoKeyword.php | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/src/Components/IntoKeyword.php b/src/Components/IntoKeyword.php index c0fa390..524d94c 100644 --- a/src/Components/IntoKeyword.php +++ b/src/Components/IntoKeyword.php @@ -25,22 +25,37 @@ class IntoKeyword extends Component * * @var array */ - public static $FIELDS_OPTIONS = array( - 'TERMINATED BY' => array(1, 'expr'), + public static $FIELDS_OPTIONS = [ + 'TERMINATED BY' => [ + 1, + 'expr', + ], 'OPTIONALLY' => 2, - 'ENCLOSED BY' => array(3, 'expr'), - 'ESCAPED BY' => array(4, 'expr'), - ); + 'ENCLOSED BY' => [ + 3, + 'expr', + ], + 'ESCAPED BY' => [ + 4, + 'expr', + ], + ]; /** * LINES Options for `SELECT...INTO` statements. * * @var array */ - public static $LINES_OPTIONS = array( - 'STARTING BY' => array(1, 'expr'), - 'TERMINATED BY' => array(2, 'expr'), - ); + public static $LINES_OPTIONS = [ + 'STARTING BY' => [ + 1, + 'expr', + ], + 'TERMINATED BY' => [ + 2, + 'expr', + ], + ]; /** * Type of target (OUTFILE or SYMBOL). @@ -128,7 +143,7 @@ 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(); @@ -188,10 +203,10 @@ class IntoKeyword extends Component $ret->dest = Expression::parse( $parser, $list, - array( + [ 'parseField' => 'table', 'breakOnAlias' => true, - ) + ] ); } else { $ret->values = ExpressionArray::parse($parser, $list); @@ -254,10 +269,10 @@ 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) . '`)' : ''; + $columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : ''; return $component->dest . $columns; } elseif (isset($component->values)) { @@ -272,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; } |