Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Open
Description
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