30 lines
735 B
PHP
30 lines
735 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Http\Responses;
|
|
|
|
use App\Framework\Http\Headers;
|
|
use App\Framework\Http\Range;
|
|
use App\Framework\Http\Response;
|
|
use App\Framework\Http\Status;
|
|
|
|
final readonly class StreamResponse implements Response, Streamable
|
|
{
|
|
|
|
public string $body;
|
|
|
|
public function __construct(
|
|
public Status $status = Status::OK,
|
|
public Headers $headers = new Headers(),
|
|
#public mixed $fileContent,
|
|
|
|
public string $filePath = '',
|
|
public int $fileSize = 0,
|
|
public string $mimeType = 'application/octet-stream',
|
|
public ?Range $range = null,
|
|
public MediaType $mediaType = MediaType::UNKNOWN,
|
|
) {
|
|
$this->body = '';
|
|
}
|
|
}
|