Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
BinaryContent | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
toHeader | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\Core\Http\Client; |
6 | |
7 | use PeServer\Core\Binary; |
8 | use PeServer\Core\Http\HttpHeader; |
9 | use PeServer\Core\Text; |
10 | |
11 | /** |
12 | * バイナリ本文データ。 |
13 | */ |
14 | class BinaryContent extends StaticContentBase |
15 | { |
16 | public function __construct( |
17 | Binary $binary, |
18 | private string $mime = Text::EMPTY |
19 | ) { |
20 | parent::__construct($binary); |
21 | } |
22 | |
23 | #region StaticContentBase |
24 | |
25 | public function toHeader(): HttpHeader |
26 | { |
27 | return $this->createContentTypeHeader($this->mime); |
28 | } |
29 | |
30 | #endregion |
31 | } |