Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
saltandvinegarcrisps committed Mar 22, 2022
1 parent dbc0b79 commit 748cdd7
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,31 @@

Example

use Codin\Stash\{
Item,
Adapter\RedisPool
Adapter\Redis\ConnectionResolver
};

$resolver = new ConnectionResolver(static function () {
return new Redis();
});
$pool = new RedisPool($resolver);

$item = new Item('my-key', 'some data');
$item->expiresAfter(3600); // 1 hour

$pool->save($item);

$item = $pool->getItem('my-key');
echo $item->get(); // some data
echo $item->isHit(); // true
```php
use Codin\Stash\{
Item,
Adapter\RedisPool
Adapter\Redis\ConnectionResolver
};

$resolver = new ConnectionResolver(static function () {
return new Redis();
});
$pool = new RedisPool($resolver);

$item = new Item('my-key', 'some data');
$item->expiresAfter(3600); // 1 hour

$pool->save($item);

$item = $pool->getItem('my-key');
echo $item->get(); // some data
echo $item->isHit(); // true
```

## Testing

```
```shell
php bin/phpstan
php bin/phpspec run
```

0 comments on commit 748cdd7

Please sign in to comment.