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

91 lines
1.5 KiB
PHP
Raw Normal View History

2021-08-04 17:13:26 +08:00
<?php
namespace Server;
2021-08-10 16:40:01 +08:00
2021-08-28 01:21:23 +08:00
use Server\Message\Response;
2021-09-09 16:38:54 +08:00
use Server\SInterface\DownloadInterface;
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
* @return DownloadInterface
*/
public function file(string $path): DownloadInterface;
/**
* @param $responseData
* @return string|array|bool|int|null
*/
public function _toArray($responseData): string|array|null|bool|int;
/**
* @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;
/**
* @return string
*/
public function getContentType(): string;
/**
* @return bool
*/
public function hasContentType(): bool;
/**
* @param string $type
* @return ResponseInterface
*/
public function withContentType(string $type): ResponseInterface;
/**
* @param string $value
* @return ResponseInterface
*/
public function withAccessControlAllowOrigin(string $value): ResponseInterface;
/**
* @param string $value
* @return ResponseInterface
*/
public function withAccessControlRequestMethod(string $value): ResponseInterface;
/**
* @param string $value
* @return ResponseInterface
*/
public function withAccessControlAllowHeaders(string $value): ResponseInterface;
2021-08-04 17:13:26 +08:00
}