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 Oct 6, 2018
2 parents ed7ad19 + 697de6a commit c067f0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
6 changes: 1 addition & 5 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -3500,13 +3500,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
4 changes: 1 addition & 3 deletions lib/Doctrine/DBAL/Platforms/DB2Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,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
4 changes: 1 addition & 3 deletions lib/Doctrine/DBAL/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -1091,10 +1091,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 c067f0f

Please sign in to comment.