]> git.mxchange.org Git - friendica.git/blobdiff - src/Capabilities/ICanCreateResponses.php
Add previous exception to unexpected worker exception logging
[friendica.git] / src / Capabilities / ICanCreateResponses.php
index 0cd5348c5331fe3cb38d689fdc58c00a31ba0fd4..dbdc61d843a64b0bca16a2384618fb76a9c0ea24 100644 (file)
@@ -1,4 +1,23 @@
 <?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 namespace Friendica\Capabilities;
 
@@ -12,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,
        ];
 
        /**
@@ -51,6 +72,16 @@ interface ICanCreateResponses
         */
        public function setType(string $type, ?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
         * @see https://www.php-fig.org/psr/psr-7/