From c58e602fc35a5f3d70010f3b59c798b5972032a0 Mon Sep 17 00:00:00 2001 From: Simon Boyer Date: Thu, 16 Nov 2017 18:08:03 +0100 Subject: [PATCH] Simplify PDO query call --- lib/Doctrine/DBAL/Driver/PDOConnection.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php index 0c0552f112f..c94eeb3aa68 100644 --- a/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php @@ -85,22 +85,8 @@ public function prepare($prepareString, $driverOptions = []) */ public function query($sql, ...$args) { - $argsCount = count($args); - try { - if ($argsCount == 3) { - return parent::query($sql, $args[0], $args[1], $args[2]); - } - - if ($argsCount == 2) { - return parent::query($sql, $args[0], $args[1]); - } - - if ($argsCount == 1) { - return parent::query($sql, $args[0]); - } - - return parent::query($sql); + return parent::query($sql, ...$args); } catch (\PDOException $exception) { throw new PDOException($exception); }