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 Feb 7, 2019
1 parent a1f9cd5 commit 9506d59
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 @@ -37,9 +37,7 @@
use function assert;
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 @@ -3472,13 +3470,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 @@ -12,8 +12,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 @@ -872,10 +870,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 @@ -15,8 +15,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 @@ -1106,10 +1104,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 9506d59

Please sign in to comment.