From bc76f2af67cc47c889a182ce86a3d03973be507c Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 22 Nov 2024 11:02:54 +0000 Subject: [PATCH] refactor confusing finally block --- src/Core/PConfig/Repository/PConfig.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Core/PConfig/Repository/PConfig.php b/src/Core/PConfig/Repository/PConfig.php index 0b47fad67d..d3b68b8ce1 100644 --- a/src/Core/PConfig/Repository/PConfig.php +++ b/src/Core/PConfig/Repository/PConfig.php @@ -75,11 +75,12 @@ class PConfig } } } catch (\Exception $exception) { - throw new PConfigPersistenceException(sprintf('Cannot load config category "%s" for user %d', $cat, $uid), $exception); - } finally { $this->db->close($configs); + throw new PConfigPersistenceException(sprintf('Cannot load config category "%s" for user %d', $cat, $uid), $exception); } + $this->db->close($configs); + return $return; }