aboutsummaryrefslogtreecommitdiff
path: root/src/Handlers/JsonAPIHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Handlers/JsonAPIHandler.php')
-rw-r--r--src/Handlers/JsonAPIHandler.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Handlers/JsonAPIHandler.php b/src/Handlers/JsonAPIHandler.php
new file mode 100644
index 0000000..cc6aa61
--- /dev/null
+++ b/src/Handlers/JsonAPIHandler.php
@@ -0,0 +1,18 @@
+<?php
+
+
+namespace Micropoly\Handlers;
+
+
+use Micropoly\Env;
+use Micropoly\Handler;
+
+abstract class JsonAPIHandler implements Handler
+{
+ abstract protected function handleAPIRequest(Env $env, array $variables): JsonAPIResult;
+
+ public function handle(Env $env, array $variables)
+ {
+ $this->handleAPIRequest($env, $variables)->send();
+ }
+} \ No newline at end of file