Make similar to DatabasePool

This commit is contained in:
Dennis Eichhorn 2017-09-26 14:12:27 +02:00
parent 1092e945ea
commit 46645f7f2b

View File

@ -104,12 +104,16 @@ class CachePool implements OptionsInterface
* *
* @since 1.0.0 * @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; return null;
} }
if(empty($key)) {
return reset($this->pool);
}
return $this->pool[$key]; return $this->pool[$key];
} }