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-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 $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
|
|
|
}
|