http-interop / http-middleware

PSR-15 interfaces for HTTP Middleware
MIT License
73 stars 7 forks source link

Method name conflict cannot prevent *misuse* #63

Closed schnittstabil closed 7 years ago

schnittstabil commented 7 years ago

Current version:

5.2 Delegate Design

Why does the delegate conflict with middleware?

Both the middleware and delegate interface define a process method to prevent misuse of middleware as delegates.

Sadly Luckily, we cannot prevent that misuse (whatever misuse means, see #56) just by naming both methods process:

class MD implements DelegateInterface, MiddlewareInterface
{
    function process(ServerRequestInterface $request, DelegateInterface $delegate = null)
    {
        //…
    }
}

See https://3v4l.org/HmpFF for details.

schnittstabil commented 7 years ago

Closing because of #66