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;
use function array_values;
use function count;
use function explode;
use function func_get_arg;
use function func_get_args;
use function func_num_args;
use function implode;
use function in_array;
use function is_array;
......@@ -3455,13 +3453,9 @@ abstract class AbstractPlatform
/**
* 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);
}
......
......@@ -13,8 +13,6 @@ use function array_merge;
use function count;
use function current;
use function explode;
use function func_get_arg;
use function func_num_args;
use function implode;
use function sprintf;
use function strpos;
......@@ -867,10 +865,8 @@ class DB2Platform extends AbstractPlatform
/**
* {@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);
}
......
......@@ -16,8 +16,6 @@ use InvalidArgumentException;
use function array_merge;
use function count;
use function explode;
use function func_get_arg;
use function func_num_args;
use function implode;
use function preg_match;
use function sprintf;
......@@ -1102,10 +1100,8 @@ SQL
/**
* {@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);
}
......
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