Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
35 | 1 | public function __construct(TelegramResponse $response) |
|
36 | { |
||
37 | 1 | $headers = $response->getHeaders(); |
|
38 | // What better to get the mime type than what the Telegram servers already send us? |
||
39 | 1 | $this->mime_type = $headers['Content-Type'][0]; |
|
40 | // Same with file length |
||
41 | 1 | $this->file_size = (int)$headers['Content-Length'][0]; |
|
42 | 1 | $this->contents = (string)$response->getResultString(); |
|
43 | 1 | } |
|
44 | |||
54 |