Add explicit status setting for PSR/ResponseInterface & add tests for OPTIONS endpoint

This commit is contained in:
Philipp 2022-01-02 21:28:28 +01:00
parent 3092e74a3a
commit eaad220738
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
6 changed files with 60 additions and 4 deletions

View file

@ -70,6 +70,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/