Files
kiri-core/http-server/Constrict/ResponseInterface.php
T

106 lines
1.7 KiB
PHP
Raw Normal View History

2021-08-04 17:13:26 +08:00
<?php
2021-09-10 10:45:24 +08:00
namespace Server\Constrict;
2021-08-04 17:13:26 +08:00
2021-08-10 16:40:01 +08:00
2021-09-09 17:01:52 +08:00
use JetBrains\PhpStorm\Pure;
2021-09-16 14:53:36 +08:00
use Http\Message\Response;
2021-09-24 02:23:24 +08:00
use Server\SInterface\OnDownloadInterface;
2021-08-10 16:40:01 +08:00
/**
* @mixin Response
*/
2021-09-09 16:38:54 +08:00
interface ResponseInterface extends \Psr\Http\Message\ResponseInterface
2021-08-04 17:13:26 +08:00
{
2021-09-09 16:38:54 +08:00
/**
* @param string $path
2021-09-24 02:23:24 +08:00
* @return OnDownloadInterface
2021-09-09 16:38:54 +08:00
*/
2021-09-24 02:23:24 +08:00
public function file(string $path): OnDownloadInterface;
2021-09-09 16:38:54 +08:00
/**
* @param $data
* @return ResponseInterface
*/
public function xml($data): ResponseInterface;
/**
* @param $data
* @return ResponseInterface
*/
public function html($data): ResponseInterface;
/**
* @param $data
* @return ResponseInterface
*/
public function json($data): ResponseInterface;
/**
2021-09-18 18:03:47 +08:00
* @return string|null
2021-09-09 16:38:54 +08:00
*/
2021-09-18 18:03:47 +08:00
public function getContentType(): ?string;
2021-09-09 16:38:54 +08:00
/**
* @return bool
*/
public function hasContentType(): bool;
/**
* @param string $type
* @return ResponseInterface
*/
public function withContentType(string $type): ResponseInterface;
/**
2021-09-09 17:05:18 +08:00
* @param ?string $value
2021-09-09 16:38:54 +08:00
* @return ResponseInterface
*/
2021-09-09 17:05:18 +08:00
public function withAccessControlAllowOrigin(?string $value): ResponseInterface;
2021-09-09 16:38:54 +08:00
/**
2021-09-09 17:05:18 +08:00
* @param ?string $value
2021-09-09 16:38:54 +08:00
* @return ResponseInterface
*/
2021-09-09 17:05:18 +08:00
public function withAccessControlRequestMethod(?string $value): ResponseInterface;
2021-09-09 16:38:54 +08:00
/**
2021-09-09 17:05:18 +08:00
* @param ?string $value
2021-09-09 16:38:54 +08:00
* @return ResponseInterface
*/
2021-09-09 17:05:18 +08:00
public function withAccessControlAllowHeaders(?string $value): ResponseInterface;
2021-09-09 16:38:54 +08:00
2021-09-09 17:01:52 +08:00
/**
* @return string|null
*/
#[Pure] public function getAccessControlAllowOrigin(): ?string;
/**
* @return string|null
*/
#[Pure] public function getAccessControlAllowHeaders(): ?string;
/**
* @return string|null
*/
#[Pure] public function getAccessControlRequestMethod(): ?string;
2021-08-04 17:13:26 +08:00
}