From 46645f7f2bfea2034ce098256ce93ee64f5a31b2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 26 Sep 2017 14:12:27 +0200 Subject: [PATCH] Make similar to DatabasePool --- DataStorage/Cache/CachePool.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DataStorage/Cache/CachePool.php b/DataStorage/Cache/CachePool.php index 8f5de89d0..eef56b141 100644 --- a/DataStorage/Cache/CachePool.php +++ b/DataStorage/Cache/CachePool.php @@ -104,12 +104,16 @@ class CachePool implements OptionsInterface * * @since 1.0.0 */ - public function get(string $key) /* : ?CacheInterface */ + public function get(string $key = '') /* : ?CacheInterface */ { - if (!isset($this->pool[$key])) { + if((!empty($key) && !isset($this->pool[$key])) || empty($this->pool)) { return null; } + if(empty($key)) { + return reset($this->pool); + } + return $this->pool[$key]; }