Unverified Commit 0ef7d47b authored by Marco Pivetta's avatar Marco Pivetta Committed by Sergei Morozov

Merge pull request #3315 from morozov/get-dummy-select-sql

Got rid of func_num_args() in AbstractPlatform::getDummySelectSQL()
parents 2b33eeff 2f7bd807
...@@ -35,9 +35,7 @@ use function array_unique; ...@@ -35,9 +35,7 @@ use function array_unique;
use function array_values; use function array_values;
use function count; use function count;
use function explode; use function explode;
use function func_get_arg;
use function func_get_args; use function func_get_args;
use function func_num_args;
use function implode; use function implode;
use function in_array; use function in_array;
use function is_array; use function is_array;
...@@ -3455,13 +3453,9 @@ abstract class AbstractPlatform ...@@ -3455,13 +3453,9 @@ abstract class AbstractPlatform
/** /**
* This is for test reasons, many vendors have special requirements for dummy statements. * This is for test reasons, many vendors have special requirements for dummy statements.
*
* @return string
*/ */
public function getDummySelectSQL() public function getDummySelectSQL(string $expression = '1') : string
{ {
$expression = func_num_args() > 0 ? func_get_arg(0) : '1';
return sprintf('SELECT %s', $expression); return sprintf('SELECT %s', $expression);
} }
......
...@@ -13,8 +13,6 @@ use function array_merge; ...@@ -13,8 +13,6 @@ use function array_merge;
use function count; use function count;
use function current; use function current;
use function explode; use function explode;
use function func_get_arg;
use function func_num_args;
use function implode; use function implode;
use function sprintf; use function sprintf;
use function strpos; use function strpos;
...@@ -867,10 +865,8 @@ class DB2Platform extends AbstractPlatform ...@@ -867,10 +865,8 @@ class DB2Platform extends AbstractPlatform
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getDummySelectSQL() public function getDummySelectSQL(string $expression = '1') : string
{ {
$expression = func_num_args() > 0 ? func_get_arg(0) : '1';
return sprintf('SELECT %s FROM sysibm.sysdummy1', $expression); return sprintf('SELECT %s FROM sysibm.sysdummy1', $expression);
} }
......
...@@ -16,8 +16,6 @@ use InvalidArgumentException; ...@@ -16,8 +16,6 @@ use InvalidArgumentException;
use function array_merge; use function array_merge;
use function count; use function count;
use function explode; use function explode;
use function func_get_arg;
use function func_num_args;
use function implode; use function implode;
use function preg_match; use function preg_match;
use function sprintf; use function sprintf;
...@@ -1102,10 +1100,8 @@ SQL ...@@ -1102,10 +1100,8 @@ SQL
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getDummySelectSQL() public function getDummySelectSQL(string $expression = '1') : string
{ {
$expression = func_num_args() > 0 ? func_get_arg(0) : '1';
return sprintf('SELECT %s FROM DUAL', $expression); return sprintf('SELECT %s FROM DUAL', $expression);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment