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] Autowiring type-hint for namespaced caches #60583

Open
@IndraGunawan

Description

@IndraGunawan

Symfony version(s) affected

7.3.0

Description

Symfony 7.3 has a great improvement on cache componenthttps://symfony.com/blog/new-in-symfony-7-3-namespaced-caches

additionalassert($this->cache instanceof NamespacedPoolInterface); required before calling the$this->cache->withSubNamespace('sub-ns'); even all caches adapters implement NamespacedPoolInterface, otherwise phpstan will complain aboutcall to undefined method

How to reproduce

had tried to use intersection types

publicfunction __construct(privateCacheInterface&NamespacedPoolInterface$appCache    )

but get this error

In DefinitionErrorExceptionPass.php line 48:                                                                                                                                                                                                                        [Symfony\Component\DependencyInjection\Exception\RuntimeException]                                                                                                                                                    Cannot autowire service"App\Command\TestCommand": argument"$appCache" of method"__construct()" hastype"Symfony\Contracts\Cache\CacheInterface&Symfony\Contracts\Cache\NamespacedPoolInterface" but this class     was not found.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    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