Skip to content

Commit

Permalink
Stabilized version
Browse files Browse the repository at this point in the history
  • Loading branch information
kodeart committed Nov 2, 2018
1 parent b6625b7 commit c19b28d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
14 changes: 7 additions & 7 deletions CacheItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

abstract class CacheItem implements CacheItemInterface
{
/** @var string */
protected $key;

/** @var mixed */
protected $value;

/** @var bool */
protected $isHit = false;

/** @var string */
private $key;

/** @var mixed */
private $value;

/** @var int Number of seconds for the expiration time */
protected $expiresAt;
private $expiresAt;


public function __construct($key, ?int $ttl)
Expand Down
2 changes: 1 addition & 1 deletion CacheItemPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class CacheItemPool implements CacheItemPoolInterface
protected $client;

/** @var CacheItemInterface[] */
protected $deferred = [];
private $deferred = [];


abstract public function __construct(CacheClientFactory $factory, string $client);
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $cache = CachePool::use('redis');

$item = $cache->getItem('fubar');
$item->set('some value');
$item->expiresAfter(new \DateTime('3 days'));
$item->expiresAfter(new DateTime('3 days'));

$cache->save();
```
Expand Down Expand Up @@ -82,17 +82,15 @@ $cache->saveDeferred($counter);
// ... do some stuff

// store this now
$cache->save($complicatedLogicDependency);
$cache->save($dependency);

// ... do more stuff

$cache->saveDeferred($updates);
$cache->saveDeferred($extras);

// Store all deferred items
$cache->commit();

// ... more stuff?
$cache->saveDeferred($yourMessedUpState);
```

License
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "koded/cache-extended",
"type": "library",
"license": "BSD-3-Clause",
"description": "A caching library for PSR-6 using several caching technologies.",
"description": "A PSR-6 caching library with support for several caching technologies.",
"keywords": [
"caching",
"cache",
Expand Down

0 comments on commit c19b28d

Please sign in to comment.