From 337c29feb9bb95a206fb939a6feca3efa4f3209e Mon Sep 17 00:00:00 2001 From: Joao Gilberto Magalhaes Date: Sat, 27 May 2017 16:07:36 -0300 Subject: [PATCH] Minor adjustments --- src/Factory.php | 2 +- src/Psr16/ArrayCacheEngine.php | 5 ++--- src/Psr16/BaseCacheEngine.php | 2 ++ src/Psr16/FileSystemCacheEngine.php | 3 ++- src/Psr16/MemcachedEngine.php | 1 - src/Psr16/NoCacheEngine.php | 2 +- src/Psr16/RedisCacheEngine.php | 2 +- src/Psr16/ShmopCacheEngine.php | 2 +- src/Psr6/CachePool.php | 2 -- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Factory.php b/src/Factory.php index c62f989..0e3c463 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -9,7 +9,7 @@ use ByJG\Cache\Psr16\RedisCacheEngine; use ByJG\Cache\Psr16\SessionCacheEngine; use ByJG\Cache\Psr16\ShmopCacheEngine; -use ByJG\Cache\Psr\CachePool; +use ByJG\Cache\Psr6\CachePool; class Factory { diff --git a/src/Psr16/ArrayCacheEngine.php b/src/Psr16/ArrayCacheEngine.php index d0482ad..d6e6120 100644 --- a/src/Psr16/ArrayCacheEngine.php +++ b/src/Psr16/ArrayCacheEngine.php @@ -3,7 +3,6 @@ namespace ByJG\Cache\Psr16; use Psr\Log\NullLogger; -use Psr\SimpleCache\DateInterval; class ArrayCacheEngine extends BaseCacheEngine { @@ -67,7 +66,7 @@ public function get($key, $default = null) * * @param string $key The key of the item to store. * @param mixed $value The value of the item to store, must be serializable. - * @param null|int|DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * @@ -97,7 +96,7 @@ public function clear() * Unlock resource * * @param string $key - * @return bool|void + * @return bool */ public function delete($key) { diff --git a/src/Psr16/BaseCacheEngine.php b/src/Psr16/BaseCacheEngine.php index bfae281..2c49ef4 100644 --- a/src/Psr16/BaseCacheEngine.php +++ b/src/Psr16/BaseCacheEngine.php @@ -47,5 +47,7 @@ protected function addToNow($ttl) $now->add($ttl); return $now->getTimestamp(); } + + return null; } } \ No newline at end of file diff --git a/src/Psr16/FileSystemCacheEngine.php b/src/Psr16/FileSystemCacheEngine.php index 797c50d..9fd19cf 100644 --- a/src/Psr16/FileSystemCacheEngine.php +++ b/src/Psr16/FileSystemCacheEngine.php @@ -66,7 +66,7 @@ public function get($key, $default = null) * * @param string $key The key of the item to store. * @param mixed $value The value of the item to store, must be serializable. - * @param null|int|DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * @@ -177,6 +177,7 @@ public function clear() foreach ($list as $file) { unlink($file); } + return true; } /** diff --git a/src/Psr16/MemcachedEngine.php b/src/Psr16/MemcachedEngine.php index e445992..9349ca7 100644 --- a/src/Psr16/MemcachedEngine.php +++ b/src/Psr16/MemcachedEngine.php @@ -2,7 +2,6 @@ namespace ByJG\Cache\Psr16; -use ByJG\Cache\CacheEngineInterface; use Memcached; use Psr\Log\NullLogger; diff --git a/src/Psr16/NoCacheEngine.php b/src/Psr16/NoCacheEngine.php index cc2e279..d9d5c20 100644 --- a/src/Psr16/NoCacheEngine.php +++ b/src/Psr16/NoCacheEngine.php @@ -28,8 +28,8 @@ public function set($key, $value, $ttl = 0) } /** - * Unlock resource * @param string $key + * @return bool */ public function delete($key) { diff --git a/src/Psr16/RedisCacheEngine.php b/src/Psr16/RedisCacheEngine.php index 7b0f274..4aa3e14 100644 --- a/src/Psr16/RedisCacheEngine.php +++ b/src/Psr16/RedisCacheEngine.php @@ -57,7 +57,7 @@ protected function fixKey($key) { /** * @param string $key The object KEY * @param int $default IGNORED IN MEMCACHED. - * @return object Description + * @return mixed Description */ public function get($key, $default = null) { diff --git a/src/Psr16/ShmopCacheEngine.php b/src/Psr16/ShmopCacheEngine.php index 2b3afbf..551a94e 100644 --- a/src/Psr16/ShmopCacheEngine.php +++ b/src/Psr16/ShmopCacheEngine.php @@ -120,7 +120,7 @@ protected function isValidAge($file) * * @param string $key The key of the item to store. * @param mixed $value The value of the item to store, must be serializable. - * @param null|int|DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * @return bool True on success and false on failure. diff --git a/src/Psr6/CachePool.php b/src/Psr6/CachePool.php index 9c4db04..9dcf165 100644 --- a/src/Psr6/CachePool.php +++ b/src/Psr6/CachePool.php @@ -2,12 +2,10 @@ namespace ByJG\Cache\Psr6; -use ByJG\Cache\CacheEngineInterface; use ByJG\Cache\Psr16\BaseCacheEngine; use Psr\Cache\CacheItemInterface; use Psr\Cache\CacheItemPoolInterface; use Psr\Log\InvalidArgumentException; -use Psr\SimpleCache\CacheInterface; class CachePool implements CacheItemPoolInterface {