Skip to content

BC breaks to ExceptionHandler class in upcoming 4.4 release #32371

@driesvints

Description

@driesvints

Symfony version(s) affected: 4.4.0

Description
#31065 removed methods from the public API of the Symfony\Component\Debug\ExceptionHandler class. Two of the methods getContent and getStylesheet are directly used by the Lumen framework here: https://github.com/laravel/lumen-framework/blob/5.8/src/Exceptions/Handler.php#L99

The following comes from the "Backward Compatibility Promise":

In short, Semantic Versioning means that only major releases (such as 2.0, 3.0 etc.) are allowed to break backward compatibility. Minor releases (such as 2.5, 2.6 etc.) may introduce new features, but must do so without breaking the existing API of that release branch.

So to me to remove these methods in a 4.x release seems like a violation of this promise. As it stands when 4.4 will be released, Lumen apps will break when people upgrade to them. Our test suite will fail and pinpoint the issue as described here: laravel/lumen-framework#935

The BC promise also notes:

Classes, properties and methods that bear the tag @internal as well as the classes located in the various *\Tests\ namespaces are an exception to this rule. They are meant for internal use only and should not be accessed by your own code.

But the ExceptionHandler class, nor any of its methods, were marked as internal.

How to reproduce

Try to use the getContent or getStylesheet method on theSymfony\Component\Debug\ExceptionHandler class on the 4.4 branch.

Possible Solution

To me it seems that if the methods with the same behavior were re-added but deprecated like the class itself, the rest of the PR could definitely be released. Or in the other case, the PR might be more suited for the 5.0 release.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions