Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

IndraGunawan
Copy link
Contributor

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60583
License MIT

autowiring CacheInterface|NamespacedPoolInterface intersection type for cache pool works well but it does not work for cache.app

@carsonbot carsonbot changed the title [Cache] set NamespacedPoolInterface alias to cache.app [FrameworkBundle] set NamespacedPoolInterface alias to cache.app Jun 2, 2025
@nicolas-grekas
Copy link
Member

Thank you @IndraGunawan.

@nicolas-grekas nicolas-grekas merged commit 37f5341 into symfony:7.3 Jun 2, 2025
11 checks passed
@fabpot fabpot mentioned this pull request Jun 28, 2025
@VincentLanglet
Copy link
Contributor

I'm not sure this is the right fix @IndraGunawan @nicolas-grekas cause this enforce the cache.app to implements the NamespacedPoolInterface or you'll get error like

{"message":"Error thrown while running command \"lint:container --env=prod\". Message: \"Invalid alias definition: alias \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\" is referencing class \"Sentry\\SentryBundle\\Tracing\\Cache\\TraceableCacheAdapter\" but this class does not implement \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\". Because this alias is an interface, \"Sentry\\SentryBundle\\Tracing\\Cache\\TraceableCacheAdapter\" must implement \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\".\"","context":{"exception":{"class":"Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException","message":"Invalid alias definition: alias \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\" is referencing class \"Sentry\\SentryBundle\\Tracing\\Cache\\TraceableCacheAdapter\" but this class does not implement \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\". Because this alias is an interface, \"Sentry\\SentryBundle\\Tracing\\Cache\\TraceableCacheAdapter\" must implement \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\".","code":0,"file":"/app/vendor/symfony/dependency-injection/Compiler/CheckAliasValidityPass.php:44"},"command":"lint:container --env=prod","message":"Invalid alias definition: alias \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\" is referencing class \"Sentry\\SentryBundle\\Tracing\\Cache\\TraceableCacheAdapter\" but this class does not implement \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\". Because this alias is an interface, \"Sentry\\SentryBundle\\Tracing\\Cache\\TraceableCacheAdapter\" must implement \"Symfony\\Contracts\\Cache\\NamespacedPoolInterface\"."}

Implementing NamespacedPoolInterface shouldn't be mandatory, or it's basically a BC break

@xabbuh
Copy link
Member

xabbuh commented Jul 6, 2025

@VincentLanglet Can you please open a new issue and provide a small example application that allows to reproduce it?

@VincentLanglet
Copy link
Contributor

Done in #61045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants