diff --git a/.travis.yml b/.travis.yml index 0a9dc07..496c218 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ cache: - $HOME/.composer/cache php: - - 7.1 - 7.2 - 7.3 @@ -31,7 +30,7 @@ before_script: - pecl install msgpack install: - - composer update -o --no-interaction --prefer-stable --ignore-platform-reqs + - composer update -o --no-interaction --prefer-stable script: - vendor/bin/phpunit --coverage-clover build/coverage/clover.xml diff --git a/README.md b/README.md index 1c71640..f149b39 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Koded - Simple Caching Library [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/1b3bad367cc74a3fa98996c252cdfe6f)](https://www.codacy.com/app/kodeart/cache-simple) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/1b3bad367cc74a3fa98996c252cdfe6f)](https://www.codacy.com/app/kodeart/cache-simple) [![Packagist Downloads](https://img.shields.io/packagist/dt/koded/cache-simple.svg)](https://packagist.org/packages/koded/cache-simple) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg)](https://php.net/) +[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)](https://php.net/) [![Software license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE) A [PSR-16][10] simple caching library for PHP 7 using several caching technologies. diff --git a/Tests/Client/FileClientTest.php b/Tests/Client/FileClientTest.php index 3f0bc7b..9d50194 100644 --- a/Tests/Client/FileClientTest.php +++ b/Tests/Client/FileClientTest.php @@ -56,7 +56,7 @@ public function test_global_ttl() $this->assertFalse($client->has('key')); } - protected function setUp() + protected function setUp(): void { $this->dir = vfsStream::setup(); } diff --git a/Tests/Client/MemoryClientTest.php b/Tests/Client/MemoryClientTest.php index d912408..8e673aa 100644 --- a/Tests/Client/MemoryClientTest.php +++ b/Tests/Client/MemoryClientTest.php @@ -45,7 +45,7 @@ public function test_global_ttl_when_set() 'Global TTL is ignored if explicit is not NULL'); } - protected function setUp() + protected function setUp(): void { putenv('CACHE_CLIENT=memory'); $this->cache = (new CacheClientFactory(new ConfigFactory))->new(); diff --git a/Tests/Configuration/MemcachedConfigurationTest.php b/Tests/Configuration/MemcachedConfigurationTest.php index a2513bf..4e752db 100644 --- a/Tests/Configuration/MemcachedConfigurationTest.php +++ b/Tests/Configuration/MemcachedConfigurationTest.php @@ -68,7 +68,7 @@ public function test_should_build_default_arguments() ], $config->getOptions()); } - protected function tearDown() + protected function tearDown(): void { putenv('MEMCACHED_POOL='); } diff --git a/Tests/FileTest.php b/Tests/FileTest.php index abffa53..d07c828 100644 --- a/Tests/FileTest.php +++ b/Tests/FileTest.php @@ -24,7 +24,7 @@ public function test_should_return_self() $this->assertInstanceOf(FileClient::class, $this->cache->client()); } - protected function setUp() + protected function setUp(): void { $dir = vfsStream::setup(); $this->cache = new FileClient(new NullLogger, $dir->url()); diff --git a/Tests/Integration/FileClientTest.php b/Tests/Integration/FileClientTest.php index 8daccd2..24bd11d 100644 --- a/Tests/Integration/FileClientTest.php +++ b/Tests/Integration/FileClientTest.php @@ -25,7 +25,7 @@ public function createSimpleCache() return simple_cache_factory('file'); } - protected function setUp() + protected function setUp(): void { $this->skippedTests = [ 'testSetMultipleInvalidKeys' => '', diff --git a/Tests/Integration/MemcachedClientTest.php b/Tests/Integration/MemcachedClientTest.php index bd6b702..026ec78 100644 --- a/Tests/Integration/MemcachedClientTest.php +++ b/Tests/Integration/MemcachedClientTest.php @@ -18,7 +18,7 @@ public function createSimpleCache() return simple_cache_factory('memcached'); } - protected function setUp() + protected function setUp(): void { if (false === extension_loaded('memcached')) { $this->markTestSkipped('Memcached extension is not loaded.'); @@ -50,39 +50,6 @@ protected function setUp() 'testSetMultipleWithGenerator' => '', 'testGetMultiple' => '', 'testSetMultipleInvalidKeys' => '', - -// 'testGetMultipleWithGenerator' => '', -// 'testDeleteMultiple' => '', -// 'testGetMultipleWithGenerator' => '', -// 'testDeleteMultiple' => '', -// 'testDeleteMultipleGenerator' => '', -// 'testHas' => '', -// 'testGetInvalidKeys' => '', -// 'testGetMultipleInvalidKeys' => '', -// 'testGetMultipleNoIterable' => '', -// 'testSetInvalidKeys' => '', -// 'testSetMultipleInvalidKeys' => '', -// 'testSetMultipleNoIterable' => '', -// 'testHasInvalidKeys' => '', -// 'testDeleteInvalidKeys' => '', -// 'testDeleteMultipleInvalidKeys' => '', -// 'testDeleteMultipleNoIterable' => '', -// 'testSetInvalidTtl' => '', -// 'testSetMultipleInvalidTtl' => '', -// 'testNullOverwrite' => '', -// 'testDataTypeString' => '', -// 'testDataTypeInteger' => '', -// 'testDataTypeFloat' => '', -// 'testDataTypeBoolean' => '', -// 'testDataTypeArray' => '', -// 'testDataTypeObject' => '', -// 'testBinaryData' => '', -// 'testSetValidKeys' => '', -// 'testSetMultipleValidKeys' => '', -// 'testSetValidData' => '', -// 'testSetMultipleValidData' => '', -// 'testObjectAsDefaultValue' => '', -// 'testObjectDoesNotChangeInCache' => '', ]; } } diff --git a/Tests/Integration/PredisClientTest.php b/Tests/Integration/PredisClientTest.php index 4d64e1b..afcd836 100644 --- a/Tests/Integration/PredisClientTest.php +++ b/Tests/Integration/PredisClientTest.php @@ -24,7 +24,7 @@ public function createSimpleCache() ]); } - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->cache->clear(); diff --git a/Tests/Integration/PredisJsonClientTest.php b/Tests/Integration/PredisJsonClientTest.php index 6329c6e..7c8f2f2 100644 --- a/Tests/Integration/PredisJsonClientTest.php +++ b/Tests/Integration/PredisJsonClientTest.php @@ -28,7 +28,7 @@ public function createSimpleCache() ]); } - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->cache->clear(); diff --git a/Tests/Integration/RedisClientTest.php b/Tests/Integration/RedisClientTest.php index c61e613..2e683c9 100644 --- a/Tests/Integration/RedisClientTest.php +++ b/Tests/Integration/RedisClientTest.php @@ -24,7 +24,7 @@ public function createSimpleCache() ]); } - protected function setUp() + protected function setUp(): void { if (false === extension_loaded('redis')) { $this->markTestSkipped('Redis extension is not loaded.'); diff --git a/Tests/Integration/RedisJsonClientTest.php b/Tests/Integration/RedisJsonClientTest.php index f796105..070c84b 100644 --- a/Tests/Integration/RedisJsonClientTest.php +++ b/Tests/Integration/RedisJsonClientTest.php @@ -27,7 +27,7 @@ public function createSimpleCache() ]); } - protected function setUp() + protected function setUp(): void { if (false === extension_loaded('redis')) { $this->markTestSkipped('Redis extension is not loaded.'); diff --git a/Tests/Integration/SimpleCacheIntegrationTrait.php b/Tests/Integration/SimpleCacheIntegrationTrait.php index 8a62a7b..2f7e8b2 100644 --- a/Tests/Integration/SimpleCacheIntegrationTrait.php +++ b/Tests/Integration/SimpleCacheIntegrationTrait.php @@ -19,7 +19,7 @@ public static function invalidKeys() return array_values($keys); } - protected function tearDown() + protected function tearDown(): void { putenv('CACHE_CLIENT='); diff --git a/Tests/InvalidSerializerTest.php b/Tests/InvalidSerializerTest.php index f65e54a..3a259f2 100644 --- a/Tests/InvalidSerializerTest.php +++ b/Tests/InvalidSerializerTest.php @@ -27,7 +27,7 @@ public function test_should_fail_on_invalid_serializer_in_configuration() ])))->new(); } - protected function setUp() + protected function setUp(): void { if (false === extension_loaded('redis')) { $this->markTestSkipped('Redis extension is not loaded.'); diff --git a/Tests/MemcachedTest.php b/Tests/MemcachedTest.php index 5ead419..bf0625a 100644 --- a/Tests/MemcachedTest.php +++ b/Tests/MemcachedTest.php @@ -15,7 +15,7 @@ public function test_should_return_memcached_client() $this->assertInstanceOf(\Memcached::class, $this->cache->client()); } - protected function setUp() + protected function setUp(): void { putenv('CACHE_CLIENT=memcached'); diff --git a/Tests/PredisConnectionTest.php b/Tests/PredisConnectionTest.php index 805c740..8277b0d 100644 --- a/Tests/PredisConnectionTest.php +++ b/Tests/PredisConnectionTest.php @@ -53,12 +53,12 @@ public function test_predis_auth_exception() ])))->new(); } - protected function setUp() + protected function setUp(): void { putenv('CACHE_CLIENT=predis'); } - protected function tearDown() + protected function tearDown(): void { putenv('CACHE_CLIENT='); } diff --git a/Tests/PredisWithJsonSerializerTest.php b/Tests/PredisWithJsonSerializerTest.php index e0e45c9..c12056e 100644 --- a/Tests/PredisWithJsonSerializerTest.php +++ b/Tests/PredisWithJsonSerializerTest.php @@ -18,7 +18,7 @@ public function test_should_return_predis_client() $this->assertInstanceOf(Client::class, $this->cache->client()); } - protected function setUp() + protected function setUp(): void { putenv('CACHE_CLIENT=predis'); diff --git a/Tests/RedisConnectionTest.php b/Tests/RedisConnectionTest.php index aa13495..5effb00 100644 --- a/Tests/RedisConnectionTest.php +++ b/Tests/RedisConnectionTest.php @@ -56,7 +56,7 @@ public function test_predis_auth_exception() $this->assertTrue($redis->client()->isConnected(), 'The auth is ignored, even it is not set in Redis'); } - protected function setUp() + protected function setUp(): void { if (false === extension_loaded('redis')) { $this->markTestSkipped('Redis extension is not loaded.'); @@ -65,7 +65,7 @@ protected function setUp() putenv('CACHE_CLIENT=redis'); } - protected function tearDown() + protected function tearDown(): void { putenv('CACHE_CLIENT='); } diff --git a/Tests/RedisWithBinarySerializerTest.php b/Tests/RedisWithBinarySerializerTest.php index 37d008d..59cb984 100644 --- a/Tests/RedisWithBinarySerializerTest.php +++ b/Tests/RedisWithBinarySerializerTest.php @@ -32,7 +32,7 @@ public function test_should_return_redis_client() $this->assertInstanceOf(\Redis::class, $this->cache->client()); } - protected function setUp() + protected function setUp(): void { putenv('CACHE_CLIENT=redis'); diff --git a/Tests/RedisWithJsonSerializerTest.php b/Tests/RedisWithJsonSerializerTest.php index 356685a..16f5e9d 100644 --- a/Tests/RedisWithJsonSerializerTest.php +++ b/Tests/RedisWithJsonSerializerTest.php @@ -16,7 +16,7 @@ public function test_should_return_redis_client() $this->assertInstanceOf(\Redis::class, $this->cache->client()); } - protected function setUp() + protected function setUp(): void { putenv('CACHE_CLIENT=redis'); diff --git a/Tests/RedisWithOnlyJsonSerializerTest.php b/Tests/RedisWithOnlyJsonSerializerTest.php index cf0a2dc..e67c5e8 100644 --- a/Tests/RedisWithOnlyJsonSerializerTest.php +++ b/Tests/RedisWithOnlyJsonSerializerTest.php @@ -66,7 +66,7 @@ public function test_should_store_and_retrieve_the_same_cache_item($data) } - protected function setUp() + protected function setUp(): void { $this->markTestSkipped('Redis JSON serializer skipped for now...'); diff --git a/Tests/SimpleCacheTestCaseTrait.php b/Tests/SimpleCacheTestCaseTrait.php index fd4a1a7..9d1bc58 100644 --- a/Tests/SimpleCacheTestCaseTrait.php +++ b/Tests/SimpleCacheTestCaseTrait.php @@ -100,7 +100,7 @@ public function simpleData() ]; } - protected function tearDown() + protected function tearDown(): void { putenv('CACHE_CLIENT='); diff --git a/VERSION b/VERSION index 359a5b9..50aea0e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 \ No newline at end of file +2.1.0 \ No newline at end of file diff --git a/composer.json b/composer.json index 5f636c3..1ad0d75 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^7.3", + "php": "^7.2", "koded/stdlib": "~4", "psr/simple-cache": "~1", "psr/log": "~1", @@ -28,7 +28,7 @@ "suggest": { "ext-redis": "For caching in Redis", "ext-memcached": "For caching in Memcached", - "predis/predis": "If you want to use Redis without ext-redis extension", + "predis/predis": "For using Redis without ext-redis extension", "ext-igbinary": "For Redis igbinary support", "ext-msgpack": "For de/serializing the cache data" }, @@ -45,10 +45,11 @@ }, "require-dev": { "phpunit/phpunit": "~7", - "mikey179/vfsStream": "~1", + "mikey179/vfsstream": "~1", "predis/predis": "dev-master", "cache/integration-tests": "dev-master", - "codacy/coverage": "dev-master" + "codacy/coverage": "dev-master", + "symfony/phpunit-bridge": "^4.4@dev" }, "extra": { "branch-alias": {