Symfony-docs: "Adapters For Interoperability between PSR-6 and PSR-16 Cache" wrong class name?

Created on 25 Jun 2019  路  2Comments  路  Source: symfony/symfony-docs

https://github.com/symfony/symfony-docs/blob/master/components/cache/psr6_psr16_adapters.rst

In the last code example is new instance of Psr6Cache. Shouldn't it be instance of Psr16Cache since you are importing Symfony\Component\Cache\Psr16Cache?

use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;

// the PSR-6 cache object that you want to use
$psr6Cache = new FilesystemAdapter();

// a PSR-16 cache that uses your cache internally!
$psr16Cache = new Psr6Cache($psr6Cache); # <--- Wrong?
$psr16Cache = new Psr16Cache($psr6Cache); # <--- Correct?

// now use this wherever you want
$githubApiClient = new GitHubApiClient($psr16Cache);
Cache Needs Review bug

Most helpful comment

Correct, PR welcome.

All 2 comments

Correct, PR welcome.

Closing as fixed by #11830.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

javiereguiluz picture javiereguiluz  路  4Comments

lbayerl picture lbayerl  路  3Comments

Kwadz picture Kwadz  路  3Comments

javiereguiluz picture javiereguiluz  路  3Comments

weaverryan picture weaverryan  路  3Comments