How to Create Middleware in Slim with Closure and Class