Hello FIG & company,

I wanted to send a quick progress report on PSR-15. Life has been busy and
the working group is doing its best to finish this up.

The first order of business is addressing the concerns brought up by Rasmus
and Michael in this thread:

https://groups.google.com/d/msg/php-fig/B3jtdJA7-6w/jzgSPrpYAQAJ

PSR-15 will define HandlerInterface, MiddlewareInterface, and
DelegateInterface. These will be two separate packages (names subject to
change):

psr/http-server-handler (handler)
psr/http-server-middleware (middleware + delegate, depends on handler)

The HandlerInterface signature will be:

__invoke(ServerRequestInterface $request): ResponseInterface

The MiddlewareInterface signature will be:

process(ServerRequestInterface $request, DelegateInterface $delegate):
ResponseInterface

The DelegateInterface will simply be an extension of HandlerInterface. (Are
we certain we need delegate?)

As such, a middleware would look something like this:

function process(ServerRequestInterface $request, DelegateInterface
$delegate)
{
    if ($this->isNotValid($request)) {
        // create ResponseInterface error
        return $response;
    }

    // all good, continue processing
    return $delegate($request);
}

As always, feedback and thoughts on this proposal are appreciated.

--
Woody Gilk
http://about.me/shadowhand

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAGOJM6%2Bz%2BFwfg9XTj%3D4BV36xm6Do-iHoUJ8p%3DH5x6MxAHJgggA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to