Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Add#[Cache()] to describe the default HTTP cache headers on controllers#46880
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
#[Cache] to describe the default HTTP cache headers on controllers# to describe the default HTTP cache headers on controllers# to describe the default HTTP cache headers on controllers#[Cache] to describe the default HTTP cache headers on controllers#[Cache] to describe the default HTTP cache headers on controllers# to describe the default HTTP cache headers on controllers# to describe the default HTTP cache headers on controllers#[Cache()] to describe the default HTTP cache headers on controllerssrc/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
e993a98 to35e176aComparesrc/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
4a33e21 toa8efdeaCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
421a733 toa63b607CompareUh oh!
There was an error while loading.Please reload this page.
076916f to7bc1513Compare| } | ||
| $action =new \ReflectionFunction($controller(...)); | ||
| $action =\is_array($controller) ?new \ReflectionMethod(...$controller) : (\is_string($controller) &&str_contains($controller,'::') ?new \ReflectionMethod($controller) :new \ReflectionFunction($controller(...))); |
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.
Needed to work aroundphp/php-src#8982
68dd91e to47b4d27Comparechalasr commentedJul 12, 2022
Thank you@nicolas-grekas. |
…stenerTest explicitly (derrabus)This PR was merged into the 6.2 branch.Discussion----------[HttpKernel] Declare properties used by CacheAttributeListenerTest explicitly| Q | A| ------------- | ---| Branch? | 6.2| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | N/A| License | MIT| Doc PR | N/AA test case introduced by#46880 triggers deprecation notices on PHP 8.2 because none of the properties used is declared. This PR fixes the build by adding explicit property declarations.Commits-------f0d0799 [HttpKernel] Declare properties used by CacheAttributeListenerTest explicitly
This PR was merged into the 6.1.x-dev branch.Discussion----------Check _cache type for compatibility with Symfony 6.2The new `#[Cache()]` attribute that is added to Symfony 6.2 (symfony/symfony#46880) is stored in the same request attribute `_cache`.Before this change, if the bundle is enabled and Symfony's Cache attribute is used, we get an error.```Call to a member function getSMaxAge() on array```This bugfix will ease migration when simultaneously usage of FrameworkExtraBundle and Symfony attributes is necessary.Commits-------0fd5fdf Check _cache type for compatibility with Symfony 6.2
Extracted from#45415 (and modernized a lot).
I'd appreciate any help for porting the other attributes following this leading PR 🙏