| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class File extends Value |
||
| 17 | { |
||
| 18 | /** @var string|resource */ |
||
| 19 | protected $content = ''; |
||
| 20 | public string $filename = 'binary'; |
||
| 21 | public string $mime = 'octet/stream'; |
||
| 22 | |||
| 23 | 4 | public function getFilename(): string |
|
| 24 | { |
||
| 25 | 4 | return strval($this->filename); |
|
| 26 | } |
||
| 27 | |||
| 28 | 4 | public function getMimeType(): string |
|
| 29 | { |
||
| 30 | 4 | return strval($this->mime); |
|
| 31 | } |
||
| 32 | |||
| 33 | 3 | public function getContent(): string |
|
| 34 | { |
||
| 35 | 3 | return is_resource($this->content) |
|
| 36 | 1 | ? strval(stream_get_contents($this->content, -1, 0)) |
|
| 37 | 3 | : strval($this->content) |
|
| 38 | 3 | ; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @throws RequestException |
||
| 43 | * @return resource |
||
| 44 | */ |
||
| 45 | 3 | public function getStream() |
|
| 54 | } |
||
| 55 | } |
||
| 56 |