This repository has been archived by the owner on Feb 24, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #714 Restore undetermined state in Cache configuration (jderusse)
This PR was merged into the 6.1.x-dev branch. Discussion ---------- Restore undetermined state in Cache configuration This PR fix a BC break introduced by #707. Given the following code: ``` /** * @Cache(smaxage="+1min") */ public function fooAction(){} ``` The headers generated by `HttpCacheListener` changed as following: ```diff - public, s-maxage=60 + private, s-maxage=60 ``` Why? Because previously the Cache's properties were null until the user provide a value. In such state, `isPublic` returns false (although `isPrivate`). And sometimes, null is expected (like the `vary` array => https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/b3596907c3d35bee5a9a1096baaeb7d465a04f30/src/EventListener/HttpCacheListener.php#L135) The #707 PR introduce 2 changes: - a value for each property is now forced by the constructor's default value. - the constructor calls the setter for each property (even if the user did not provide a value for it), some setter (ie. `setPublic`) does not expect a null value and convert null into something. It looks like, only the Cache configuration is affected. Other Configuration has already a default value defined for each property. This PR restore the default `null` value for all properties and prevent the constructor to call the setter when the value is null. Commits ------- 99e749b Restore undetermined state in Cache configuration
- Loading branch information