From 3b6afa66d1e9fd2e68a8ddbfe0520c6df86b1c58 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sun, 26 Jul 2020 22:37:01 +0300 Subject: [PATCH] fix(cache): fix all cache drivers names --- .../Cache/{AcpuAdapter.php => AcpuCacheAdapter.php} | 2 +- .../Cache/{ArrayAdapter.php => ArrayCacheAdapter.php} | 2 +- .../{FilesystemAdapter.php => FilesystemCacheAdapter.php} | 2 +- .../{MemcachedAdapter.php => MemcachedCacheAdapter.php} | 2 +- .../Cache/{PhpFileAdapter.php => PhpFileCacheAdapter.php} | 3 ++- .../Cache/{RedisAdapter.php => RedisCacheAdapter.php} | 2 +- .../Cache/{SQLite3Adapter.php => SQLite3CacheAdapter.php} | 2 +- .../{WinCacheAdapter.php => WinCacheCacheAdapter.php} | 2 +- ...dDataCacheAdapter.php => ZendDataCacheCacheAdapter.php} | 2 +- src/flextype/dependencies.php | 7 +++---- 10 files changed, 13 insertions(+), 13 deletions(-) rename src/flextype/app/Foundation/Cache/{AcpuAdapter.php => AcpuCacheAdapter.php} (86%) rename src/flextype/app/Foundation/Cache/{ArrayAdapter.php => ArrayCacheAdapter.php} (86%) rename src/flextype/app/Foundation/Cache/{FilesystemAdapter.php => FilesystemCacheAdapter.php} (90%) rename src/flextype/app/Foundation/Cache/{MemcachedAdapter.php => MemcachedCacheAdapter.php} (92%) rename src/flextype/app/Foundation/Cache/{PhpFileAdapter.php => PhpFileCacheAdapter.php} (87%) rename src/flextype/app/Foundation/Cache/{RedisAdapter.php => RedisCacheAdapter.php} (95%) rename src/flextype/app/Foundation/Cache/{SQLite3Adapter.php => SQLite3CacheAdapter.php} (93%) rename src/flextype/app/Foundation/Cache/{WinCacheAdapter.php => WinCacheCacheAdapter.php} (85%) rename src/flextype/app/Foundation/Cache/{ZendDataCacheAdapter.php => ZendDataCacheCacheAdapter.php} (84%) diff --git a/src/flextype/app/Foundation/Cache/AcpuAdapter.php b/src/flextype/app/Foundation/Cache/AcpuCacheAdapter.php similarity index 86% rename from src/flextype/app/Foundation/Cache/AcpuAdapter.php rename to src/flextype/app/Foundation/Cache/AcpuCacheAdapter.php index 10ca65ea..df695630 100644 --- a/src/flextype/app/Foundation/Cache/AcpuAdapter.php +++ b/src/flextype/app/Foundation/Cache/AcpuCacheAdapter.php @@ -7,7 +7,7 @@ namespace Flextype\App\Foundation\Cache; use Doctrine\Cache\Common\AcpuCache; use Psr\Container\ContainerInterface; -class AcpuAdapter implements CacheAdapterInterface +class AcpuCacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/app/Foundation/Cache/ArrayAdapter.php b/src/flextype/app/Foundation/Cache/ArrayCacheAdapter.php similarity index 86% rename from src/flextype/app/Foundation/Cache/ArrayAdapter.php rename to src/flextype/app/Foundation/Cache/ArrayCacheAdapter.php index 987ec6eb..42970eb6 100644 --- a/src/flextype/app/Foundation/Cache/ArrayAdapter.php +++ b/src/flextype/app/Foundation/Cache/ArrayCacheAdapter.php @@ -7,7 +7,7 @@ namespace Flextype\App\Foundation\Cache; use Doctrine\Common\Cache\ArrayCache; use Psr\Container\ContainerInterface; -class ArrayAdapter implements CacheAdapterInterface +class ArrayCacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/app/Foundation/Cache/FilesystemAdapter.php b/src/flextype/app/Foundation/Cache/FilesystemCacheAdapter.php similarity index 90% rename from src/flextype/app/Foundation/Cache/FilesystemAdapter.php rename to src/flextype/app/Foundation/Cache/FilesystemCacheAdapter.php index c0612971..2c904ca6 100644 --- a/src/flextype/app/Foundation/Cache/FilesystemAdapter.php +++ b/src/flextype/app/Foundation/Cache/FilesystemCacheAdapter.php @@ -8,7 +8,7 @@ use Doctrine\Common\Cache\FilesystemCache; use Flextype\Component\Filesystem\Filesystem; use Psr\Container\ContainerInterface; -class FilesystemAdapter implements CacheAdapterInterface +class FilesystemCacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/app/Foundation/Cache/MemcachedAdapter.php b/src/flextype/app/Foundation/Cache/MemcachedCacheAdapter.php similarity index 92% rename from src/flextype/app/Foundation/Cache/MemcachedAdapter.php rename to src/flextype/app/Foundation/Cache/MemcachedCacheAdapter.php index 32cee3c4..7351031d 100644 --- a/src/flextype/app/Foundation/Cache/MemcachedAdapter.php +++ b/src/flextype/app/Foundation/Cache/MemcachedCacheAdapter.php @@ -8,7 +8,7 @@ use Doctrine\Common\Cache\MemcachedCache; use Memecached; use Psr\Container\ContainerInterface; -class MemcachedAdapter implements CacheAdapterInterface +class MemcachedCacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/app/Foundation/Cache/PhpFileAdapter.php b/src/flextype/app/Foundation/Cache/PhpFileCacheAdapter.php similarity index 87% rename from src/flextype/app/Foundation/Cache/PhpFileAdapter.php rename to src/flextype/app/Foundation/Cache/PhpFileCacheAdapter.php index 10f934a0..0945ab0d 100644 --- a/src/flextype/app/Foundation/Cache/PhpFileAdapter.php +++ b/src/flextype/app/Foundation/Cache/PhpFileCacheAdapter.php @@ -8,7 +8,7 @@ use Doctrine\Common\Cache\PhpFileCache; use Psr\Container\ContainerInterface; use Flextype\Component\Filesystem\Filesystem; -class PhpFileAdapter implements CacheAdapterInterface +class PhpFileCacheAdapter extends PhpFileCache implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { @@ -25,4 +25,5 @@ class PhpFileAdapter implements CacheAdapterInterface return new PhpFileCache($cache_directory); } + } diff --git a/src/flextype/app/Foundation/Cache/RedisAdapter.php b/src/flextype/app/Foundation/Cache/RedisCacheAdapter.php similarity index 95% rename from src/flextype/app/Foundation/Cache/RedisAdapter.php rename to src/flextype/app/Foundation/Cache/RedisCacheAdapter.php index 50bb18ff..c0b5fcb3 100644 --- a/src/flextype/app/Foundation/Cache/RedisAdapter.php +++ b/src/flextype/app/Foundation/Cache/RedisCacheAdapter.php @@ -9,7 +9,7 @@ use Psr\Container\ContainerInterface; use Redis; use RedisException; -class RedisAdapter implements CacheAdapterInterface +class RedisCacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/app/Foundation/Cache/SQLite3Adapter.php b/src/flextype/app/Foundation/Cache/SQLite3CacheAdapter.php similarity index 93% rename from src/flextype/app/Foundation/Cache/SQLite3Adapter.php rename to src/flextype/app/Foundation/Cache/SQLite3CacheAdapter.php index 4f44b3e4..e6937a27 100644 --- a/src/flextype/app/Foundation/Cache/SQLite3Adapter.php +++ b/src/flextype/app/Foundation/Cache/SQLite3CacheAdapter.php @@ -9,7 +9,7 @@ use Flextype\Component\Filesystem\Filesystem; use Psr\Container\ContainerInterface; use SQLite3; -class SQLite3Adapter implements CacheAdapterInterface +class SQLite3CacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/app/Foundation/Cache/WinCacheAdapter.php b/src/flextype/app/Foundation/Cache/WinCacheCacheAdapter.php similarity index 85% rename from src/flextype/app/Foundation/Cache/WinCacheAdapter.php rename to src/flextype/app/Foundation/Cache/WinCacheCacheAdapter.php index eb59d4b4..0ba4c507 100644 --- a/src/flextype/app/Foundation/Cache/WinCacheAdapter.php +++ b/src/flextype/app/Foundation/Cache/WinCacheCacheAdapter.php @@ -7,7 +7,7 @@ namespace Flextype\App\Foundation\Cache; use Doctrine\Common\Cache\WinCacheCache; use Psr\Container\ContainerInterface; -class WinCacheAdapter implements CacheAdapterInterface +class WinCacheCacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/app/Foundation/Cache/ZendDataCacheAdapter.php b/src/flextype/app/Foundation/Cache/ZendDataCacheCacheAdapter.php similarity index 84% rename from src/flextype/app/Foundation/Cache/ZendDataCacheAdapter.php rename to src/flextype/app/Foundation/Cache/ZendDataCacheCacheAdapter.php index 5460e8f2..f4a104b2 100644 --- a/src/flextype/app/Foundation/Cache/ZendDataCacheAdapter.php +++ b/src/flextype/app/Foundation/Cache/ZendDataCacheCacheAdapter.php @@ -7,7 +7,7 @@ namespace Flextype\App\Foundation\Cache; use Doctrine\Common\Cache\ZendDataCache; use Psr\Container\ContainerInterface; -class ZendDataCacheAdapter implements CacheAdapterInterface +class ZendDataCacheCacheAdapter implements CacheAdapterInterface { public function __construct(ContainerInterface $flextype) { diff --git a/src/flextype/dependencies.php b/src/flextype/dependencies.php index 92f6d8b8..48f48ba7 100644 --- a/src/flextype/dependencies.php +++ b/src/flextype/dependencies.php @@ -108,16 +108,15 @@ $flextype['cache_adapter'] = function ($container) use ($flextype) { if (! $driver_name || $driver_name === 'auto') { if (extension_loaded('apcu')) { - $driver_name = 'apcu'; + $driver_name = 'Apcu'; } elseif (extension_loaded('wincache')) { - $driver_name = 'wincache'; + $driver_name = 'WinCache'; } else { $driver_name = 'PhpFile'; } } - $class = ucfirst($driver_name); - $adapter = "Flextype\\App\\Foundation\\Cache\\{$class}Adapter"; + $adapter = "Flextype\\App\\Foundation\\Cache\\{$driver_name}CacheAdapter"; return new $adapter($flextype); };