Skip to content

Conversation

@odan
Copy link
Contributor

@odan odan commented Jun 1, 2025

Changes compared to the initial PR for Slim 5.

Added

  • Implemented RequestHandlerInterface in the App class.

  • New middlewares for error handling with content negotiation:

    • HtmlExceptionMiddleware
    • JsonExceptionMiddleware
    • XmlExceptionMiddleware
    • PlainTextExceptionMiddleware
    • ErrorExceptionMiddleware to convert PHP errors into ErrorException.
    • Shared ExceptionMiddlewareTrait for reusable error-handling logic.
  • New middlewares for request body parsing (replacing the BodyParsingMiddleware):

    • JsonBodyParserMiddleware
    • XmlBodyParserMiddleware
    • FormUrlEncodedBodyParserMiddleware
  • Added check for supported body parser handlers.

Changed

  • Refactored the entire error-handling concept:
    • Replaced old error renderers with new middleware-based architecture.
    • Renamed ErrorHandlingMiddleware to ErrorExceptionMiddleware.
    • Updated HeadMethodMiddleware to use StreamFactoryInterface.

Removed

  • Old error renderers:

    • HtmlExceptionRenderer
    • JsonExceptionRenderer
    • XmlExceptionRenderer
    • PlainTextExceptionRenderer
  • ExceptionHandlingMiddleware and ExceptionRendererTrait

  • Utility class JsonRenderer

  • BodyParsingMiddleware

@odan odan added the Slim 5 label Jun 1, 2025
@odan odan merged commit 626bbbd into slimphp:5.x Jun 1, 2025
3 checks passed
@coveralls
Copy link

Coverage Status

coverage: 98.808% (+0.1%) from 98.663%
when pulling b22b0d1 on odan:5.x
into 89b8de3 on slimphp:5.x.

@akrabat
Copy link
Member

akrabat commented Jun 2, 2025

Looks promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants