]> git.mxchange.org Git - friendica.git/blobdiff - src/Capabilities/ICanCreateResponses.php
Unneeded logging removed
[friendica.git] / src / Capabilities / ICanCreateResponses.php
index f0dac471f5ba8f99a6fba447d2562f40f83cfbcb..837e0cd8862baea8235803146faf1ef2e98f2306 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -31,18 +31,20 @@ interface ICanCreateResponses
         */
        const X_HEADER = 'X-RESPONSE-TYPE';
 
-       const TYPE_HTML = 'html';
-       const TYPE_XML  = 'xml';
-       const TYPE_JSON = 'json';
-       const TYPE_ATOM = 'atom';
-       const TYPE_RSS  = 'rss';
+       const TYPE_HTML  = 'html';
+       const TYPE_XML   = 'xml';
+       const TYPE_JSON  = 'json';
+       const TYPE_ATOM  = 'atom';
+       const TYPE_RSS   = 'rss';
+       const TYPE_BLANK = 'blank';
 
        const ALLOWED_TYPES = [
                self::TYPE_HTML,
                self::TYPE_XML,
                self::TYPE_JSON,
                self::TYPE_ATOM,
-               self::TYPE_RSS
+               self::TYPE_RSS,
+               self::TYPE_BLANK,
        ];
 
        /**
@@ -68,7 +70,17 @@ interface ICanCreateResponses
         *
         * @throws InternalServerErrorException
         */
-       public function setType(string $type, ?string $content_type = null): void;
+       public function setType(string $type = ICanCreateResponses::TYPE_HTML, ?string $content_type = null): void;
+
+       /**
+        * Sets the status and the reason for the response
+        *
+        * @param int $status The HTTP status code
+        * @param null|string $reason Reason phrase (when empty a default will be used based on the status code)
+        *
+        * @return void
+        */
+       public function setStatus(int $status = 200, ?string $reason = null): void;
 
        /**
         * Creates a PSR-7 compliant interface