Skip to content

Commit fa42c10

Browse files
Ocramiusmorozov
authored andcommitted
Merge pull request #3315 from morozov/get-dummy-select-sql
Got rid of func_num_args() in AbstractPlatform::getDummySelectSQL()
2 parents abe7d95 + f7707af commit fa42c10

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

lib/Doctrine/DBAL/Platforms/AbstractPlatform.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
use function array_values;
3636
use function count;
3737
use function explode;
38-
use function func_get_arg;
3938
use function func_get_args;
40-
use function func_num_args;
4139
use function implode;
4240
use function in_array;
4341
use function is_array;
@@ -3455,13 +3453,9 @@ public function getTruncateTableSQL($tableName, $cascade = false)
34553453

34563454
/**
34573455
* This is for test reasons, many vendors have special requirements for dummy statements.
3458-
*
3459-
* @return string
34603456
*/
3461-
public function getDummySelectSQL()
3457+
public function getDummySelectSQL(string $expression = '1') : string
34623458
{
3463-
$expression = func_num_args() > 0 ? func_get_arg(0) : '1';
3464-
34653459
return sprintf('SELECT %s', $expression);
34663460
}
34673461

lib/Doctrine/DBAL/Platforms/DB2Platform.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
use function count;
1414
use function current;
1515
use function explode;
16-
use function func_get_arg;
17-
use function func_num_args;
1816
use function implode;
1917
use function sprintf;
2018
use function strpos;
@@ -867,10 +865,8 @@ public function getForUpdateSQL()
867865
/**
868866
* {@inheritDoc}
869867
*/
870-
public function getDummySelectSQL()
868+
public function getDummySelectSQL(string $expression = '1') : string
871869
{
872-
$expression = func_num_args() > 0 ? func_get_arg(0) : '1';
873-
874870
return sprintf('SELECT %s FROM sysibm.sysdummy1', $expression);
875871
}
876872

lib/Doctrine/DBAL/Platforms/OraclePlatform.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
use function array_merge;
1717
use function count;
1818
use function explode;
19-
use function func_get_arg;
20-
use function func_num_args;
2119
use function implode;
2220
use function preg_match;
2321
use function sprintf;
@@ -1102,10 +1100,8 @@ public function getTruncateTableSQL($tableName, $cascade = false)
11021100
/**
11031101
* {@inheritDoc}
11041102
*/
1105-
public function getDummySelectSQL()
1103+
public function getDummySelectSQL(string $expression = '1') : string
11061104
{
1107-
$expression = func_num_args() > 0 ? func_get_arg(0) : '1';
1108-
11091105
return sprintf('SELECT %s FROM DUAL', $expression);
11101106
}
11111107

0 commit comments

Comments
 (0)