mirror of
https://github.com/getgrav/grav.git
synced 2026-03-04 19:41:36 +01:00
Fixes wrong exception in ChainCache
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Grav\Framework\Cache\Adapter;
|
||||
|
||||
use Grav\Framework\Cache\AbstractCache;
|
||||
use Grav\Framework\Cache\CacheInterface;
|
||||
use Grav\Framework\Cache\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Cache class for PSR-16 compatible "Simple Cache" implementation using chained cache adapters.
|
||||
@@ -32,19 +33,19 @@ class ChainCache extends AbstractCache
|
||||
* Chain Cache constructor.
|
||||
* @param array $caches
|
||||
* @param null|int|\DateInterval $defaultLifetime
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(array $caches, $defaultLifetime = null)
|
||||
{
|
||||
parent::__construct('', $defaultLifetime);
|
||||
|
||||
if (!$caches) {
|
||||
throw new \InvalidArgumentException('At least one cache must be specified');
|
||||
throw new InvalidArgumentException('At least one cache must be specified');
|
||||
}
|
||||
|
||||
foreach ($caches as $cache) {
|
||||
if (!$cache instanceof CacheInterface) {
|
||||
throw new \InvalidArgumentException(
|
||||
throw new InvalidArgumentException(
|
||||
sprintf(
|
||||
"The class '%s' does not implement the '%s' interface",
|
||||
get_class($cache),
|
||||
|
||||
@@ -194,6 +194,7 @@ class FileCache extends AbstractCache
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @throws \ErrorException
|
||||
*/
|
||||
public static function throwError($type, $message, $file, $line)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user