mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-07 04:58:40 +00:00
Make similar to DatabasePool
This commit is contained in:
parent
1092e945ea
commit
46645f7f2b
|
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user