Make sure to always return the correct type from the Memcached->getMultiple call

This commit is contained in:
Timothy Warren 2017-03-01 11:42:42 -05:00
parent 29556b4fdf
commit 0aa750e2c6
2 changed files with 3 additions and 7 deletions

View File

@ -141,15 +141,10 @@ class ApcuDriver extends AbstractDriver {
* @return boolean * @return boolean
*/ */
public function flush(): bool public function flush(): bool
{
if (function_exists('apcu_clear_cache'))
{ {
return apcu_clear_cache(); return apcu_clear_cache();
} }
return TRUE;
}
/** /**
* Set the specified key to expire at the given time * Set the specified key to expire at the given time
* *

View File

@ -101,7 +101,8 @@ class MemcachedDriver extends AbstractDriver {
*/ */
public function getMultiple(array $keys = []): array public function getMultiple(array $keys = []): array
{ {
return $this->conn->getMulti($keys); $return = $this->conn->getMulti($keys);
return ($return === FALSE) ? [] : $return;
} }
/** /**