summaryrefslogtreecommitdiffstats
path: root/src/Utils/Routine.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils/Routine.php')
-rw-r--r--src/Utils/Routine.php48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/Utils/Routine.php b/src/Utils/Routine.php
index 9b075dc..9842ff1 100644
--- a/src/Utils/Routine.php
+++ b/src/Utils/Routine.php
@@ -1,8 +1,8 @@
<?php
-
/**
* Routine utilities.
*/
+declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Utils;
@@ -36,27 +36,27 @@ class Routine
$type = DataType::parse(new Parser(), $lexer->list);
if ($type === null) {
- return array(
+ return [
+ '',
'',
'',
'',
'',
- ''
- );
+ ];
}
- $options = array();
+ $options = [];
foreach ($type->options->options as $opt) {
$options[] = is_string($opt) ? $opt : $opt['value'];
}
- return array(
+ return [
'',
'',
$type->name,
implode(',', $type->parameters),
- implode(' ', $options)
- );
+ implode(' ', $options),
+ ];
}
/**
@@ -74,29 +74,29 @@ class Routine
$param = ParameterDefinition::parse(new Parser(), $lexer->list);
if (empty($param[0])) {
- return array(
+ return [
+ '',
'',
'',
'',
'',
- ''
- );
+ ];
}
$param = $param[0];
- $options = array();
+ $options = [];
foreach ($param->type->options->options as $opt) {
$options[] = is_string($opt) ? $opt : $opt['value'];
}
- return array(
+ return [
empty($param->inOut) ? '' : $param->inOut,
$param->name,
$param->type->name,
implode(',', $param->type->parameters),
- implode(' ', $options)
- );
+ implode(' ', $options),
+ ];
}
/**
@@ -108,15 +108,15 @@ class Routine
*/
public static function getParameters($statement)
{
- $retval = array(
+ $retval = [
'num' => 0,
- 'dir' => array(),
- 'name' => array(),
- 'type' => array(),
- 'length' => array(),
- 'length_arr' => array(),
- 'opts' => array()
- );
+ 'dir' => [],
+ 'name' => [],
+ 'type' => [],
+ 'length' => [],
+ 'length_arr' => [],
+ 'opts' => [],
+ ];
if (! empty($statement->parameters)) {
$idx = 0;
@@ -126,7 +126,7 @@ class Routine
$retval['type'][$idx] = $param->type->name;
$retval['length'][$idx] = implode(',', $param->type->parameters);
$retval['length_arr'][$idx] = $param->type->parameters;
- $retval['opts'][$idx] = array();
+ $retval['opts'][$idx] = [];
foreach ($param->type->options->options as $opt) {
$retval['opts'][$idx][] = is_string($opt) ?
$opt : $opt['value'];