From 73bd402551aff64fc528e2e0ea7166b320965107 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 19 Jan 2018 12:03:32 +0200 Subject: [PATCH] `Framework\Cache`: Update all exceptions to be compatible with `Psr\SimpleCache` --- .../Framework/Cache/Adapter/ChainCache.php | 2 +- .../Framework/Cache/Adapter/DoctrineCache.php | 3 ++- .../Framework/Cache/Adapter/FileCache.php | 4 ++-- .../src/Grav/Framework/Cache/CacheTrait.php | 22 +++++++++---------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/system/src/Grav/Framework/Cache/Adapter/ChainCache.php b/system/src/Grav/Framework/Cache/Adapter/ChainCache.php index eed108457..041b676f2 100644 --- a/system/src/Grav/Framework/Cache/Adapter/ChainCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/ChainCache.php @@ -33,7 +33,7 @@ class ChainCache extends AbstractCache * Chain Cache constructor. * @param array $caches * @param null|int|\DateInterval $defaultLifetime - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function __construct(array $caches, $defaultLifetime = null) { diff --git a/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php b/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php index 25e42ea98..3a69c1ff9 100644 --- a/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php @@ -29,7 +29,7 @@ class DoctrineCache extends AbstractCache * @param CacheProvider $doctrineCache * @param string $namespace * @param null|int|\DateInterval $defaultLifetime - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function __construct(CacheProvider $doctrineCache, $namespace = '', $defaultLifetime = null) { @@ -96,6 +96,7 @@ public function doSetMultiple($values, $ttl) /** * @inheritdoc + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function doDeleteMultiple($keys) { diff --git a/system/src/Grav/Framework/Cache/Adapter/FileCache.php b/system/src/Grav/Framework/Cache/Adapter/FileCache.php index d703f6190..389b626e1 100644 --- a/system/src/Grav/Framework/Cache/Adapter/FileCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/FileCache.php @@ -62,7 +62,7 @@ public function doGet($key, $miss) /** * @inheritdoc - * @throws CacheException + * @throws \Psr\SimpleCache\CacheException */ public function doSet($key, $value, $ttl) { @@ -136,7 +136,7 @@ protected function getFile($key, $mkdir = false) /** * @param string $namespace * @param string $directory - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ private function init($namespace, $directory) { diff --git a/system/src/Grav/Framework/Cache/CacheTrait.php b/system/src/Grav/Framework/Cache/CacheTrait.php index c80bc3ac9..7fb37c1f9 100644 --- a/system/src/Grav/Framework/Cache/CacheTrait.php +++ b/system/src/Grav/Framework/Cache/CacheTrait.php @@ -36,7 +36,7 @@ trait CacheTrait * * @param string $namespace * @param null|int|\DateInterval $defaultLifetime - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ protected function init($namespace = '', $defaultLifetime = null) { @@ -63,7 +63,7 @@ protected function getDefaultLifetime() /** * @inheritdoc - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function get($key, $default = null) { @@ -76,7 +76,7 @@ public function get($key, $default = null) /** * @inheritdoc - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function set($key, $value, $ttl = null) { @@ -90,7 +90,7 @@ public function set($key, $value, $ttl = null) /** * @inheritdoc - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function delete($key) { @@ -109,7 +109,7 @@ public function clear() /** * @inheritdoc - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function getMultiple($keys, $default = null) { @@ -149,7 +149,7 @@ public function getMultiple($keys, $default = null) /** * @inheritdoc - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function setMultiple($values, $ttl = null) { @@ -180,7 +180,7 @@ public function setMultiple($values, $ttl = null) /** * @inheritdoc - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function deleteMultiple($keys) { @@ -206,7 +206,7 @@ public function deleteMultiple($keys) /** * @inheritdoc - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ public function has($key) { @@ -274,7 +274,7 @@ abstract public function doHas($key); /** * @param string $key - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ protected function validateKey($key) { @@ -303,7 +303,7 @@ protected function validateKey($key) /** * @param array $keys - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ protected function validateKeys($keys) { @@ -315,7 +315,7 @@ protected function validateKeys($keys) /** * @param null|int|\DateInterval $ttl * @return int|null - * @throws InvalidArgumentException + * @throws \Psr\SimpleCache\InvalidArgumentException */ protected function convertTtl($ttl) {