From c37d75825eab257af4e269a5d066ffe261ec8ec3 Mon Sep 17 00:00:00 2001 From: daniel bannert Date: Mon, 25 Jan 2016 00:35:30 +0100 Subject: [PATCH 1/2] update composer Update readme doc Update composer to use cache/integration-tests v0.7 not dev-master Skip more tests remove table fix spelling mistakes | update doc modified: README.md remove line modified: README.md Update readme doc Update composer to use cache/integration-tests v0.7 not dev-master Skip more tests remove table fix spelling mistakes | update doc modified: README.md remove line modified: README.md adding missing s modified: README.md update composer php-cache/issues/issues/23 next small upadtes modified: README.md modified: composer.json modified: tests/IntegrationPoolTest.php modified: README.md modified: composer.json --- README.md | 33 ++++++++++++++++++++++++--------- composer.json | 8 ++++---- tests/IntegrationPoolTest.php | 5 +++++ 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2dd561f..8998a20 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,26 @@ -# Void PSR-6 adapter -[![Build Status](https://travis-ci.org/php-cache/void-adapter.svg?branch=master)](https://travis-ci.org/php-cache/void-adapter) [![codecov.io](https://codecov.io/github/php-cache/void-adapter/coverage.svg?branch=master)](https://codecov.io/github/php-cache/void-adapter?branch=master) +# Void PSR-6 Cache pool +[![Latest Stable Version](https://poser.pugx.org/cache/void-adapter/v/stable)](https://packagist.org/packages/cache/void-adapter) [![codecov.io](https://codecov.io/github/php-cache/void-adapter/coverage.svg?branch=master)](https://codecov.io/github/php-cache/void-adapter?branch=master) [![Build Status](https://travis-ci.org/php-cache/void-adapter.svg?branch=master)](https://travis-ci.org/php-cache/void-adapter) [![Total Downloads](https://poser.pugx.org/cache/void-adapter/downloads)](https://packagist.org/packages/cache/void-adapter) [![Monthly Downloads](https://poser.pugx.org/cache/void-adapter/d/monthly.png)](https://packagist.org/packages/cache/void-adapter) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) -This is a void implementation of PSR-6. Other names for this adapter could be Blackhole or Null. This -adapter does not save anything and will always return an empty CacheItem. +This is a void implementation of a PSR-6 cache. Other names for this adapter could be Blackhole or Null. This adapter does not save anything and will always return an empty CacheItem. It is a part of the PHP Cache organisation. To read about features like tagging and hierarchy support please read the shared documentation at [www.php-cache.com](www.php-cache.com. -| Feature | Supported | -| ------- | --------- | -| Flush everything | No -| Expiration time | No -| Tagging | Yes +### Install + +```bash +composer require cache/void-adapter +``` + +### Configure + +You do not need to do any configuration to use the `VoidCachePool`. + +### Usage + +```php +use Cache\Adapter\Void\VoidCachePool; + +$pool = new VoidCachePool(); +``` + +### Contribute + +Contributions are very welcome! Send us a pull request or report any issues you find on the [issue tracker](http://issues.php-cache.com). diff --git a/composer.json b/composer.json index 7d9323f..2697e28 100644 --- a/composer.json +++ b/composer.json @@ -28,14 +28,14 @@ "require": { "php": "^5.5|^7.0", - "psr/cache": "1.0.0", - "cache/adapter-common": "^0.1", - "cache/taggable-cache": "^0.2" + "psr/cache": "~1.0", + "cache/adapter-common": "^0.2", + "cache/taggable-cache": "^0.3" }, "require-dev": { "phpunit/phpunit": "^5.1|^4.0", - "cache/integration-tests": "dev-master" + "cache/integration-tests": "^0.7" }, "provide": { diff --git a/tests/IntegrationPoolTest.php b/tests/IntegrationPoolTest.php index 46c34b4..f5c296b 100644 --- a/tests/IntegrationPoolTest.php +++ b/tests/IntegrationPoolTest.php @@ -23,6 +23,11 @@ class IntegrationPoolTest extends BaseTest 'testHasItem' => 'Void adapter does not save,', 'testDeleteItems' => 'Void adapter does not save,', 'testSave' => 'Void adapter does not save,', + 'testSaveWithoutExpire' => 'Void adapter does not save,', + 'testDataTypeFloat' => 'Void adapter only outputs boolean,', + 'testDataTypeBoolean' => 'Void adapter only outputs boolean,', + 'testDataTypeArray' => 'Void adapter only outputs boolean,', + 'testDataTypeObject' => 'Void adapter only outputs boolean,', 'testDeferredSave' => 'Void adapter does not save,', 'testDeferredSaveWithoutCommit' => 'Void adapter does not save,', 'testCommit' => 'Void adapter does not save,', From 1ad43d0b2437436af7744bcf8daa7c02b6549890 Mon Sep 17 00:00:00 2001 From: daniel bannert Date: Mon, 25 Jan 2016 20:35:07 +0100 Subject: [PATCH 2/2] update VoidCachePool to match cache/adapter-common v0.2 --- src/VoidCachePool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VoidCachePool.php b/src/VoidCachePool.php index 0a87d04..329b3ab 100644 --- a/src/VoidCachePool.php +++ b/src/VoidCachePool.php @@ -21,7 +21,7 @@ class VoidCachePool extends AbstractCachePool { protected function fetchObjectFromCache($key) { - return false; + return [false, null]; } protected function clearAllObjectsFromCache()