X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCapabilities%2FICanCreateResponses.php;h=837e0cd8862baea8235803146faf1ef2e98f2306;hb=67a6bc3ea91286d6ddc03a23ace491dd995b6b0e;hp=0cd5348c5331fe3cb38d689fdc58c00a31ba0fd4;hpb=6a9fff5100fa58e07a9812bb1836f3caca854379;p=friendica.git diff --git a/src/Capabilities/ICanCreateResponses.php b/src/Capabilities/ICanCreateResponses.php index 0cd5348c53..837e0cd886 100644 --- a/src/Capabilities/ICanCreateResponses.php +++ b/src/Capabilities/ICanCreateResponses.php @@ -1,4 +1,23 @@ . + * + */ 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, ]; /** @@ -49,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