From a354bb949ee9b20baa2f961e5428cae528c634f5 Mon Sep 17 00:00:00 2001 From: Bertrand GAUTHIER <bertrand.gauthier@unicaen.fr> Date: Wed, 2 Jun 2021 10:43:15 +0200 Subject: [PATCH] =?UTF-8?q?[FIX]=20->rowCount()=20ne=20fonctionne=20qu'apr?= =?UTF-8?q?=C3=A8s=20->fetch()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UnicaenDbImport/QueryExecutor.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/UnicaenDbImport/QueryExecutor.php b/src/UnicaenDbImport/QueryExecutor.php index 20c76d4..55f2fc0 100644 --- a/src/UnicaenDbImport/QueryExecutor.php +++ b/src/UnicaenDbImport/QueryExecutor.php @@ -89,11 +89,7 @@ class QueryExecutor { $statement = $this->executeQuery($sql, $connection); - if ($statement->rowCount() === 0) { - return null; - } - - return $statement->fetch(\PDO::FETCH_ASSOC); + return $statement->fetch(\PDO::FETCH_ASSOC) ?: null; } /** -- GitLab