Browse Source

Add __invoke method to the HttpApplicationInterface.

HTTP Application should be treated as a middleware.
Robert Pustułka 8 years ago
parent
commit
62dbf83442
1 changed files with 13 additions and 0 deletions
  1. 13 0
      src/Core/HttpApplicationInterface.php

+ 13 - 0
src/Core/HttpApplicationInterface.php

@@ -13,6 +13,9 @@
  */
 namespace Cake\Core;
 
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\ServerRequestInterface;
+
 /**
  * An interface defining the methods that the
  * http server depend on.
@@ -45,4 +48,14 @@ interface HttpApplicationInterface
      * @return \Cake\Http\MiddlewareQueue
      */
     public function middleware($middleware);
+
+    /**
+     * Invoke the application.
+     *
+     * @param \Psr\Http\Message\ServerRequestInterface $request The request
+     * @param \Psr\Http\Message\ResponseInterface $response The response
+     * @param callable $next The next middleware
+     * @return \Psr\Http\Message\ResponseInterface
+     */
+    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next);
 }