-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+650
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[Cache]
to describe the default HTTP cache headers on controllers#
to describe the default HTTP cache headers on controllers
7 tasks
#
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 controllers
HeahDude
reviewed
Jul 7, 2022
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Outdated
Show resolved
Hide resolved
e993a98
to
35e176a
Compare
94noni
reviewed
Jul 7, 2022
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Outdated
Show resolved
Hide resolved
derrabus
reviewed
Jul 8, 2022
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Outdated
Show resolved
Hide resolved
4a33e21
to
a8efdea
Compare
HeahDude
reviewed
Jul 9, 2022
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php
Show resolved
Hide resolved
421a733
to
a63b607
Compare
chalasr
approved these changes
Jul 12, 2022
076916f
to
7bc1513
Compare
nicolas-grekas
commented
Jul 12, 2022
@@ -61,7 +61,7 @@ public function setController(callable $controller, array $attributes = null): v | |||
unset($this->attributes); | |||
} | |||
|
|||
$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 around php/php-src#8982
68dd91e
to
47b4d27
Compare
…s on controllers
47b4d27
to
acd4fa7
Compare
GromNaN
approved these changes
Jul 12, 2022
weaverryan
approved these changes
Jul 12, 2022
Thank you @nicolas-grekas. |
chalasr
added a commit
that referenced
this pull request
Jul 14, 2022
…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/A A 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
Merged
fabpot
added a commit
to sensiolabs/SensioFrameworkExtraBundle
that referenced
this pull request
Nov 1, 2022
This PR was merged into the 6.1.x-dev branch. Discussion ---------- Check _cache type for compatibility with Symfony 6.2 The 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extracted from #45415 (and modernized a lot).
I'd appreciate any help for porting the other attributes following this leading PR 🙏