Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cache] Make ArrayAdapter and NullAdapter taggable #61114

Open
Labels
@dmitryuk

Description

@dmitryuk

Description

Hello. The issue that I use RedisTagAwareAdapter for production, but need to test it in memory with ArrayAdapter or NullAdapter, which doesn't implements TagAwareAdapterInterface.

So for tests inproduction code I should check if adapter implements TagAwareAdapterInterface and, for example, add tags to cache item:

// production code below// adapter can be RedisTagAwareAdapter or ArrayAdapter or NullAdapter        if ($this->adapter instanceof TagAwareAdapterInterface) {            $item->tag([self::TAG]);        }

Without checking I will get an error'Cache item "%s" comes from a non tag-aware pool: you cannot tag it.'.
Finally code is not totally covered

I think will be great to create new class ArrayTagAwareAdapter and add interface TagAwareAdapterInterface to NullAdapter out-of-box to easier test Cache layer.

What do you think?

p.s. before doing a PR I started this short discussion

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp