From de9ce7615e303b1e24476f9f9d1eaf40b5cf2bc3 Mon Sep 17 00:00:00 2001 From: Toby Griffiths Date: Mon, 19 Oct 2020 20:34:56 +0100 Subject: [PATCH] Adds exception thrown by execute() method My IDE was telling me I was trying to catch a non-existent exception, however it's clear by digging down a level that the Exception is throw by this class, so this simply annotates that. Perhaps this should catch it and throw a QueryException? --- lib/Doctrine/DBAL/Query/QueryBuilder.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Doctrine/DBAL/Query/QueryBuilder.php b/lib/Doctrine/DBAL/Query/QueryBuilder.php index 492a06951bb..5ba7fea12d7 100644 --- a/lib/Doctrine/DBAL/Query/QueryBuilder.php +++ b/lib/Doctrine/DBAL/Query/QueryBuilder.php @@ -4,6 +4,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver\ResultStatement; +use Doctrine\DBAL\Exception; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Query\Expression\CompositeExpression; use Doctrine\DBAL\Query\Expression\ExpressionBuilder; @@ -200,6 +201,8 @@ public function getState() * Executes this query using the bound parameters and their types. * * @return ResultStatement|int + * + * @throws Exception */ public function execute() {