From 2ac69b438c9dd6c2232c391a06c988a404e45ac8 Mon Sep 17 00:00:00 2001 From: Thibaud Fabre Date: Wed, 20 Jan 2016 12:41:31 +0100 Subject: [PATCH] Replicate contains/fetch pattern in traceable cache for accuracy --- lib/Alchemy/Phrasea/Core/Profiler/TraceableCache.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Alchemy/Phrasea/Core/Profiler/TraceableCache.php b/lib/Alchemy/Phrasea/Core/Profiler/TraceableCache.php index ff5d9add06..3f336b8abf 100644 --- a/lib/Alchemy/Phrasea/Core/Profiler/TraceableCache.php +++ b/lib/Alchemy/Phrasea/Core/Profiler/TraceableCache.php @@ -264,6 +264,10 @@ class TraceableCache implements Cache, PhraseaCache */ public function get($key) { + if ( ! $this->contains($key)) { + throw new Exception('Unable to retrieve the value'); + } + return $this->fetch($key); }