-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WIP] [Cache] Allow to chain adapters #17452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think the decorator pattern is the wrong way. All adapters must be able to handle it. Like this: https://github.com/php-cache/chain-adapter/blob/master/src/CachePoolChain.php |
The chain suits probably better to this case, indeed. |
I was thinking that all adapters was extending the abstract class but it's not the case (and it's why this PR is marked as WIP). |
@@ -109,7 +129,6 @@ function ($deferred, $namespace) { | |||
public function getItem($key) | |||
{ | |||
$id = $this->getId($key); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be reverted
Replaced by #17556. |
private $decorated; | ||
|
||
/** | ||
* @var array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Just by looking at the default value, I know this is an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has been replaced by #17556. The new one doesn't include docblocks changes anymore.
Allows to chain adapters (e.g: use the
ArrayAdapter
and fallback to theDoctrineAdapter
).ArrayAdapter
ProxyAdapter