Skip to content

Create "Middleware" article in "Internals" #318

Description

@vjik

Convention about failure handler in middleware should be written.

Because each failure handler is specific for each middleware, so it shouldn't implement RequestHandlerInterface. So separate failure handler interface should be created for each middleware.

Example:

interface AuthenticationFailureHandlerInterface
{
    public function handle(ServerRequestInterface $request): ResponseInterface;
}

When failure handler requires some context, it should be a second parameter in handle() metod. For example:

interface ThrowableHandlerInterface
{
    public function create(ServerRequestInterface $request, Throwable $throwable): ResponseInterface;
}

Related PRs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions