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

[HttpKernel] Allow ErrorHandler ^5.0 to be used in HttpKernel 4.4#46327

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

Merged
derrabus merged 1 commit intosymfony:4.4frommpdude:allow-error-handler-5
May 11, 2022

Conversation

@mpdude
Copy link
Contributor

@mpdudempdude commentedMay 11, 2022
edited
Loading

QA
Branch?4.4
Bug fix?no
New feature?yes
Deprecations?no
Tickets
LicenseMIT
Doc PR

I wonder what prevents us from allowing HttpKernel ^4.4 to be used with ErrorHandler ^5.0?

ErrorHandler 5.4 (IIRC) adds the incredibly helpful feature ❤️‍🔥 to emit deprecation notices for missing return type hints. This is valuable when trying to migrate larger codebases to make use of type hints.

Symfony 4.4 is the current LTS, and this PR would allow people to switch to ErrorHandler 5.4 while the rest of the code can still use Symfony 4.4 components.

@carsonbotcarsonbot added this to the4.4 milestoneMay 11, 2022
@mpdudempdude changed the titleAllow ErrorHandler ^5.0 to be used in HttpKernelAllow ErrorHandler ^5.0 to be used in HttpKernel 4.4May 11, 2022
@carsonbotcarsonbot changed the titleAllow ErrorHandler ^5.0 to be used in HttpKernel 4.4[HttpKernel] Allow ErrorHandler ^5.0 to be used in HttpKernel 4.4May 11, 2022
@derrabusderrabus added Bug and removed Feature labelsMay 11, 2022
@derrabus
Copy link
Member

I wonder what prevents us from allowing HttpKernel ^4.4 to be used with ErrorHandler ^5.0?

This was done in7ec445b by@nicolas-grekas. Not sure if he still knows why he did that back then.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

I don't remember, certainly an issue with the CI, but it's green now 🤷
Works for me since most projects will use flex to still force 4.4 so they won't be affected.

@derrabus
Copy link
Member

Thank you Matthias.

@derrabusderrabus merged commit1e317cc intosymfony:4.4May 11, 2022
@mpdude
Copy link
ContributorAuthor

Your pace is awesome, thank you guys!

@mpdudempdude deleted the allow-error-handler-5 branchMay 11, 2022 16:49
@mpdude
Copy link
ContributorAuthor

mpdude commentedMay 13, 2022
edited
Loading

⚠️ see comment atsymfony/http-kernel@486baf0.

Cannot tell right now if that’s an incompatibility between Symfony packages and/or the person did not declare their dependencies correctly.

mpdude referenced this pull request in symfony/http-kernelMay 13, 2022
@stof
Copy link
Member

Well, they probably don't have a direct dependency on symfony/error-handler in their project, and upgrading to version 5 of the error handler removed the BC layer with symfony/debug (but for a project upgrading Symfony 4 from minor to minor, not having a requirement on symfony/error-handler is quite expected as earlier versions of symfony/http-kernel were using symfony/debug for that feature)

@mpdude
Copy link
ContributorAuthor

mpdude commentedMay 14, 2022
edited
Loading

I think the situation is as follows:

  • The ExceptionController in TwigBundle 4.4 expects a Symfony\Component\Debug\Exception\FlattenException (here)
  • In ErrorHandler 4.4, the Symfony\Component\ErrorHandler\Exception\FlattenException isa subclass of the (at that time already deprecated) Symfony\Component\Debug\Exception\FlattenException
  • With the change from this PR, ErrorHandler 5.x may be installed, where Symfony\Component\ErrorHandler\Exception\FlattenException no longer extends the legacy base class (here)

I might be wrong, but is this a missing depencendy declaration (either requires or maybe conflicts) in TwigBundle 4.4 against either ErrorHandler or the Debug component?

Reasons against this: TwigBundle does not require either one, and also has no problem when ErrorHandler 5.x is installed... it just can't handle exceptions generated in ErrorHandler 5.x.

Another suggestion: I could change the ExceptionController in TwigBundle 4.4 to be kind of forwards-compatible and accept either Exceptions from Debugor ErrorHandler. But that change would probably be breaking BC for users inheriting from that Controller and overwriting the method, right?

@fabpotfabpot mentioned this pull requestMay 14, 2022
@mpdude
Copy link
ContributorAuthor

mpdude commentedMay 16, 2022
edited
Loading

Would it be OK if ErrorHandler'sFlattenException in 5.4 would still inherit from Symfony\Component\Debug\Exception\FlattenException if that class exists (decided at runtime)?

@nicolas-grekas
Copy link
Member

The point of doing a major version bump is to get rid of those hacks. I think we should revert this PR. That's quite unfortunate but we cannot afford breaking existing stacks I fear.

@stof
Copy link
Member

I agree about reverting that PR.

@mpdude
Copy link
ContributorAuthor

Also agree!

@mpdude
Copy link
ContributorAuthor

Should we learn from this that some kind of test is missing… if so, what might that be?

@stof
Copy link
Member

The missing test would be a functional test triggering the rendering of an error page.

nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull requestMay 16, 2022
…used in HttpKernel 4.4 (mpdude)"This reverts commit1e317cc, reversingchanges made to129a271.
@nicolas-grekas
Copy link
Member

Reverted in#46365

nicolas-grekas added a commit that referenced this pull requestMay 16, 2022
… be used" (nicolas-grekas)This PR was merged into the 4.4 branch.Discussion----------[HttpKernel] Revert "bug#46327  Allow ErrorHandler ^5.0 to be used"| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -This reverts commit1e317cc, reversingchanges made to129a271.As discussed in#46327Commits-------c206591 Revert "bug#46327 [HttpKernel] Allow ErrorHandler ^5.0 to be used in HttpKernel 4.4 (mpdude)"
nicolas-grekas added a commit that referenced this pull requestMay 17, 2022
* 4.4:  [Mime] Add null check for EmailHeaderSame  Add approriate description to CollectionToArrayTransformer::reverseTransform docblock  [PropertyInfo] CS fixes  [VarDumper] fix test on PHP 8.2  [Config] Fix looking for single files in phars with GlobResource  Revert "bug#46327 [HttpKernel] Allow ErrorHandler ^5.0 to be used in HttpKernel 4.4 (mpdude)"
nicolas-grekas added a commit that referenced this pull requestMay 17, 2022
* 5.4:  [VarDumper] fix tests on PHP 8.2  [Mime] Add null check for EmailHeaderSame  Add approriate description to CollectionToArrayTransformer::reverseTransform docblock  [PropertyInfo] CS fixes  [VarDumper] fix test on PHP 8.2  [Config] Fix looking for single files in phars with GlobResource  Revert "bug#46327 [HttpKernel] Allow ErrorHandler ^5.0 to be used in HttpKernel 4.4 (mpdude)"
nicolas-grekas added a commit that referenced this pull requestMay 17, 2022
* 6.0:  [VarDumper] fix tests on PHP 8.2  [Mime] Add null check for EmailHeaderSame  Add approriate description to CollectionToArrayTransformer::reverseTransform docblock  [PropertyInfo] CS fixes  [VarDumper] fix test on PHP 8.2  [Config] Fix looking for single files in phars with GlobResource  Revert "bug#46327 [HttpKernel] Allow ErrorHandler ^5.0 to be used in HttpKernel 4.4 (mpdude)"
This was referencedMay 27, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@derrabusderrabusderrabus approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@mpdude@derrabus@stof@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp