Skip to content

Commit

Permalink
Merge pull request #3315 from morozov/get-dummy-select-sql
Browse files Browse the repository at this point in the history
Got rid of func_num_args() in AbstractPlatform::getDummySelectSQL()
  • Loading branch information
Ocramius authored and morozov committed Oct 7, 2018
2 parents 8c4f2dc + 7d59452 commit e5a586e
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 @@ -3439,13 +3437,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 @@ -1103,10 +1101,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 e5a586e

Please sign in to comment.