b13/slimphp-bridge

Add noop return from Slim route

Opened this issue · 2 comments

I want to create a Slim callback that in some cases does nothing - in this case the calling middleware handler should keep on going. SlimInitiator could check for a special Slim callback response (NoOp) to handle that case.

Hi @saneinsane

Can you elaborate on what you are trying to achieve?

Hi @dogawaf,
I had a case where the Slim Middleware hooked in and I wanted the API implementation behind to give back the request control to the next middleware instead of returning a response itself. If I remember right I implemented this in my fork throwing a "NoOp"-Exception from the implementation and handled that exception type within the SlimInitiator so that it returns $handler->handle($request);. Might be an edge case, on the other hand it doesn’t cost too much complexity.