Skip to content

Commit

Permalink
Got rid of func_num_args in AbstractPlatform::getDummySelectSQL()
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Nov 25, 2018
1 parent 2b33eef commit 2f7bd80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
8 changes: 1 addition & 7 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
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;
Expand Down Expand Up @@ -3455,13 +3453,9 @@ public function getTruncateTableSQL($tableName, $cascade = false)

/**
* 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);
}

Expand Down
6 changes: 1 addition & 5 deletions lib/Doctrine/DBAL/Platforms/DB2Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
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;
Expand Down Expand Up @@ -867,10 +865,8 @@ public function getForUpdateSQL()
/**
* {@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);
}

Expand Down
6 changes: 1 addition & 5 deletions lib/Doctrine/DBAL/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
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;
Expand Down Expand Up @@ -1102,10 +1100,8 @@ public function getTruncateTableSQL($tableName, $cascade = false)
/**
* {@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);
}

Expand Down

0 comments on commit 2f7bd80

Please sign in to comment.