-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Deprecate *Response::create() methods #34771
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
Conversation
db949ec
to
ebb13e7
Compare
This PR was merged into the 5.1-dev branch. Discussion ---------- Deprecate *Response::create() methods | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a<!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | - The `::create()` methods of the `Response` class hierarchy are not needed anymore in modern PHP versions as we can use parenthesis around the new operator. So `Response::create()->...()` is equivalent to `(new Response)->...()`. Let's deprecate the static method. It's also good as the first parameter type changes depending on the sub-class. Commits ------- ebb13e7 Deprecate *Response::create() methods
HttpFoundation | ||
-------------- | ||
|
||
* Deprecate `Response::create()`, `JsonResponse::create()`, |
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.
should be Deprecated
for consistency (all messages are using the past in the upgrade guide)
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.
I'm slowly moving to use more "modern" message patterns as use everywhere else.
This PR was merged into the 4.3 branch. Discussion ---------- *Response::create() method is deprecated @fabpot deprecated `*Response::create()` methods in symfony/symfony#34771 I think we can use `__construct` from the lowest version on (no occurences in `3.4`, so `4.3`) from now! No need to mention the deprecation itself in the docs IMHO Thats why I target `4.3` Commits ------- e930ea9 *Response::create() method is deprecated
…) (derrabus) This PR was merged into the 5.2 branch. Discussion ---------- [HttpFoundation] Deprecate BinaryFileResponse::create() | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | N/A | License | MIT | Doc PR | N/A Follows #34771. We've deprecated the static `::create()` methods on all response classes but `BinaryFileResponse`. This PR proposes to fix this inconsistency. Commits ------- 9ce2e86 [HttpFoundation] Deprecate BinaryFileResponse::create().
The
::create()
methods of theResponse
class hierarchy are not needed anymore in modern PHP versions as we can use parenthesis around the new operator. SoResponse::create()->...()
is equivalent to(new Response)->...()
.Let's deprecate the static method. It's also good as the first parameter type changes depending on the sub-class.