Skip to content

Commit 45cabcd

Browse files
committed
Merge pull request #4 from PrisisForks/update-taggable-cache-and-tests
Update taggable cache and tests
2 parents 5451339 + 1ad43d0 commit 45cabcd

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
# Void PSR-6 adapter
2-
[![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)
1+
# Void PSR-6 Cache pool
2+
[![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)
33

4-
This is a void implementation of PSR-6. Other names for this adapter could be Blackhole or Null. This
5-
adapter does not save anything and will always return an empty CacheItem.
4+
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.
65

7-
| Feature | Supported |
8-
| ------- | --------- |
9-
| Flush everything | No
10-
| Expiration time | No
11-
| Tagging | Yes
6+
### Install
7+
8+
```bash
9+
composer require cache/void-adapter
10+
```
11+
12+
### Configure
13+
14+
You do not need to do any configuration to use the `VoidCachePool`.
15+
16+
### Usage
17+
18+
```php
19+
use Cache\Adapter\Void\VoidCachePool;
20+
21+
$pool = new VoidCachePool();
22+
```
23+
24+
### Contribute
25+
26+
Contributions are very welcome! Send us a pull request or report any issues you find on the [issue tracker](http://issues.php-cache.com).

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"require":
2929
{
3030
"php": "^5.5|^7.0",
31-
"psr/cache": "1.0.0",
32-
"cache/adapter-common": "^0.1",
33-
"cache/taggable-cache": "^0.2"
31+
"psr/cache": "~1.0",
32+
"cache/adapter-common": "^0.2",
33+
"cache/taggable-cache": "^0.3"
3434
},
3535
"require-dev":
3636
{
3737
"phpunit/phpunit": "^5.1|^4.0",
38-
"cache/integration-tests": "dev-master"
38+
"cache/integration-tests": "^0.7"
3939
},
4040
"provide":
4141
{

src/VoidCachePool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class VoidCachePool extends AbstractCachePool
2121
{
2222
protected function fetchObjectFromCache($key)
2323
{
24-
return false;
24+
return [false, null];
2525
}
2626

2727
protected function clearAllObjectsFromCache()

tests/IntegrationPoolTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class IntegrationPoolTest extends BaseTest
2323
'testHasItem' => 'Void adapter does not save,',
2424
'testDeleteItems' => 'Void adapter does not save,',
2525
'testSave' => 'Void adapter does not save,',
26+
'testSaveWithoutExpire' => 'Void adapter does not save,',
27+
'testDataTypeFloat' => 'Void adapter only outputs boolean,',
28+
'testDataTypeBoolean' => 'Void adapter only outputs boolean,',
29+
'testDataTypeArray' => 'Void adapter only outputs boolean,',
30+
'testDataTypeObject' => 'Void adapter only outputs boolean,',
2631
'testDeferredSave' => 'Void adapter does not save,',
2732
'testDeferredSaveWithoutCommit' => 'Void adapter does not save,',
2833
'testCommit' => 'Void adapter does not save,',

0 commit comments

Comments
 (0)