Replicate contains/fetch pattern in traceable cache for accuracy

This commit is contained in:
Thibaud Fabre
2016-01-20 12:41:31 +01:00
parent 587b5beb27
commit 2ac69b438c

View File

@@ -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);
}