From 4dce2981c177a1a5166aa57742f0fd88c8793f47 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 5 Oct 2018 20:00:49 -0700 Subject: [PATCH] Got rid of func_num_args in AbstractPlatform::getDummySelectSQL() --- lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | 8 +------- lib/Doctrine/DBAL/Platforms/DB2Platform.php | 6 +----- lib/Doctrine/DBAL/Platforms/OraclePlatform.php | 6 +----- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 30d7fb415e7..efcb40ba611 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -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; @@ -3454,13 +3452,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); } diff --git a/lib/Doctrine/DBAL/Platforms/DB2Platform.php b/lib/Doctrine/DBAL/Platforms/DB2Platform.php index d8f2a724553..5d85dfec485 100644 --- a/lib/Doctrine/DBAL/Platforms/DB2Platform.php +++ b/lib/Doctrine/DBAL/Platforms/DB2Platform.php @@ -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; @@ -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); } diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index c47c9417ba7..aa962704e8f 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -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; @@ -1100,10 +1098,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); }