PHP8
[m6w6/seekat] / lib / API / ContentType / Handler.php
diff --git a/lib/API/ContentType/Handler.php b/lib/API/ContentType/Handler.php
new file mode 100644 (file)
index 0000000..d6cd7c6
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace seekat\API\ContentType;
+
+use http\Message\Body;
+
+interface Handler {
+       /**
+        * List handled types
+        * @return array
+        */
+       function types() : array;
+
+       /**
+        * Decode HTTP message body
+        * @param Body $body
+        * @return mixed
+        */
+       function decode(Body $body);
+
+       /**
+        * Encode HTTP message body
+        * @param $data
+        * @return Body
+        */
+       function encode($data) : Body;
+}