Skip to content

Commit

Permalink
Framework\Cache: Update all exceptions to be compatible with `Psr\S…
Browse files Browse the repository at this point in the history
…impleCache`
  • Loading branch information
mahagr committed Jan 19, 2018
1 parent c473c0b commit 73bd402
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion system/src/Grav/Framework/Cache/Adapter/ChainCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion system/src/Grav/Framework/Cache/Adapter/DoctrineCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -96,6 +96,7 @@ public function doSetMultiple($values, $ttl)

/**
* @inheritdoc
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function doDeleteMultiple($keys)
{
Expand Down
4 changes: 2 additions & 2 deletions system/src/Grav/Framework/Cache/Adapter/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function doGet($key, $miss)

/**
* @inheritdoc
* @throws CacheException
* @throws \Psr\SimpleCache\CacheException
*/
public function doSet($key, $value, $ttl)
{
Expand Down Expand Up @@ -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)
{
Expand Down
22 changes: 11 additions & 11 deletions system/src/Grav/Framework/Cache/CacheTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -63,7 +63,7 @@ protected function getDefaultLifetime()

/**
* @inheritdoc
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function get($key, $default = null)
{
Expand All @@ -76,7 +76,7 @@ public function get($key, $default = null)

/**
* @inheritdoc
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function set($key, $value, $ttl = null)
{
Expand All @@ -90,7 +90,7 @@ public function set($key, $value, $ttl = null)

/**
* @inheritdoc
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function delete($key)
{
Expand All @@ -109,7 +109,7 @@ public function clear()

/**
* @inheritdoc
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function getMultiple($keys, $default = null)
{
Expand Down Expand Up @@ -149,7 +149,7 @@ public function getMultiple($keys, $default = null)

/**
* @inheritdoc
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function setMultiple($values, $ttl = null)
{
Expand Down Expand Up @@ -180,7 +180,7 @@ public function setMultiple($values, $ttl = null)

/**
* @inheritdoc
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function deleteMultiple($keys)
{
Expand All @@ -206,7 +206,7 @@ public function deleteMultiple($keys)

/**
* @inheritdoc
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function has($key)
{
Expand Down Expand Up @@ -274,7 +274,7 @@ abstract public function doHas($key);

/**
* @param string $key
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
protected function validateKey($key)
{
Expand Down Expand Up @@ -303,7 +303,7 @@ protected function validateKey($key)

/**
* @param array $keys
* @throws InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
protected function validateKeys($keys)
{
Expand All @@ -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)
{
Expand Down

0 comments on commit 73bd402

Please sign in to comment.