Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpFoundation] Add support for DateTimeImmutable in setters#19727

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

Closed
dvdoug wants to merge1 commit intosymfony:3.1fromdvdoug:httpfoundation_response_datetimeimmutable
Closed

[HttpFoundation] Add support for DateTimeImmutable in setters#19727

dvdoug wants to merge1 commit intosymfony:3.1fromdvdoug:httpfoundation_response_datetimeimmutable

Conversation

@dvdoug
Copy link

QA
Branch?3.1
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

Backwards compatibility is assured by typehinting for DateTimeInterface, and converting to \DateTime for onward use

This is my first PR for Symfony, so please let me know if I've done something not quite right.

Backwards compatibility is assured by typehinting for DateTimeInterface, and converting to \DateTime for onward use
@linaori
Copy link
Contributor

The problem is that when someone extends the response and the methods you change the signature of, it will cause compatibility issues afaik.

nicolas-grekas and apfelbox reacted with thumbs up emoji

@dvdoug
Copy link
Author

Urgh, I suppose that is indeed true although I can't imagine anyone actually extending those methods.

If I targeted this to master would you take it?

@linaori
Copy link
Contributor

The master would still mean it's a BC break and that cannot be accepted :(

@ro0NL
Copy link
Contributor

ro0NL commentedAug 24, 2016
edited
Loading

Same as#19578

These changes need a4.0-dev branch :)

@wouterj
Copy link
Member

These changes need a 4.0-dev branch :)

No, there never can be a BC break in Symfony.

@ro0NL
Copy link
Contributor

ro0NL commentedAug 24, 2016
edited
Loading

4.0 will have BC breaks..? Anyway, currentlymaster == 3.2-dev, not 4.0-dev. Hence, we cannot break. Hence, wemaybe limiting ourselves :)

Having a branch targeting 4.0 is considerable as you can actually make these changes somewhere and you prepare the release beforehand.

Pro: actually have your upcoming version in VCS
Con: more work with VCS :)

@linaori
Copy link
Contributor

Method signatures other than constructors can't really be provided via a BC layer

@ro0NL
Copy link
Contributor

ro0NL commentedAug 24, 2016
edited
Loading

I would consider this BC break in 4.0 :) but it can't be done. Lets move forward :)

edit: we could consider documenting the break now, and not forget to make the change in 4.0 (like not forgetting to remove the deprecations, etc.)

* @return Response
*/
publicfunctionsetDate(\DateTime$date)
publicfunctionsetDate(\DateTimeInterface$date)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What about renaming it tosetDateHeader for bc ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

technically, it would work yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Another solution could be to deprecate extending this functions and make them final in 4.0 (i prefer this solution).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@Ener-Getick let's give it a try, would you mind opening a PR doing this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

sure, see#19734

fabpot added a commit that referenced this pull requestSep 14, 2016
…r-Getick)This PR was merged into the 3.2-dev branch.Discussion----------[HttpFoundation] Deprecate extending some methods| Q             | A| ------------- | ---| Branch?       | "master"| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |#19727| License       | MIT| Doc PR        |It's really hard to change methods signature because of bc. I'm proposing to deprecate extending some getters/setters of `Response` because of this (and because extending them is not really useful).If you like this approach it could be used in other places to simplify bc in 4.0.Edit: This causes issues (warnings always triggered) when mocking `Response` entirely but does it matter as people should only mock needed methods?Commits-------c0a26bc [HttpFoundation] Deprecate extending some methods
symfony-splitter pushed a commit to symfony/http-foundation that referenced this pull requestSep 14, 2016
…r-Getick)This PR was merged into the 3.2-dev branch.Discussion----------[HttpFoundation] Deprecate extending some methods| Q             | A| ------------- | ---| Branch?       | "master"| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |symfony/symfony#19727| License       | MIT| Doc PR        |It's really hard to change methods signature because of bc. I'm proposing to deprecate extending some getters/setters of `Response` because of this (and because extending them is not really useful).If you like this approach it could be used in other places to simplify bc in 4.0.Edit: This causes issues (warnings always triggered) when mocking `Response` entirely but does it matter as people should only mock needed methods?Commits-------c0a26bc [HttpFoundation] Deprecate extending some methods
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@dvdoug@linaori@ro0NL@wouterj@nicolas-grekas@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp