Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
DownloadDataContent | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\Core\Mvc; |
6 | |
7 | use PeServer\Core\Binary; |
8 | use PeServer\Core\Http\HttpStatus; |
9 | use PeServer\Core\Mime; |
10 | use PeServer\Core\Mvc\DataContent; |
11 | |
12 | /** |
13 | * ダウンロード用データ。 |
14 | */ |
15 | readonly class DownloadDataContent extends DataContent |
16 | { |
17 | #region variable |
18 | |
19 | public readonly string $fileName; |
20 | |
21 | #endregion |
22 | |
23 | /** |
24 | * 生成。 |
25 | * |
26 | * @param non-empty-string $mime |
27 | * @phpstan-param non-empty-string|\PeServer\Core\Mime::* $mime |
28 | * @param string|Binary $data |
29 | */ |
30 | public function __construct(string $mime, string $fileName, string|Binary $data) |
31 | { |
32 | parent::__construct(HttpStatus::None, $mime, $data); |
33 | $this->fileName = $fileName; |
34 | } |
35 | } |