summaryrefslogtreecommitdiffstats
path: root/src/ControllerInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/ControllerInterface.php')
-rw-r--r--src/ControllerInterface.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ControllerInterface.php b/src/ControllerInterface.php
new file mode 100644
index 0000000..8225457
--- /dev/null
+++ b/src/ControllerInterface.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Jasny;
+
+use Psr\Http\Message\ServerRequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * Interface for controllers
+ */
+interface ControllerInterface
+{
+ /**
+ * Run the controller as function
+ *
+ * @param ServerRequestInterface $request
+ * @param ResponseInterface $response
+ * @return ResponseInterface
+ */
+ public function __invoke(ServerRequestInterface $request, ResponseInterface $response);
+}