1 | <?php |
||
12 | class UnknownFileModel extends iDokladAbstractModel |
||
13 | { |
||
14 | /** |
||
15 | * RAW content of file (should be saved to disc with some filename+extension). |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $content; |
||
20 | |||
21 | /** |
||
22 | * MIME-type detected of raw content. You can check extension by this MIME. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $mime; |
||
27 | |||
28 | /** |
||
29 | * @throws \RuntimeException |
||
30 | */ |
||
31 | public function __construct() |
||
37 | |||
38 | /** |
||
39 | * @param ResponseInterface $response |
||
40 | * |
||
41 | * @throws \Exception |
||
42 | * |
||
43 | * @return iDokladModelInterface |
||
44 | */ |
||
45 | public static function createFromResponse(ResponseInterface $response): iDokladModelInterface |
||
49 | |||
50 | /** |
||
51 | * @param string $raw |
||
52 | * |
||
53 | * @throws \Exception |
||
54 | * |
||
55 | * @return iDokladModelInterface |
||
56 | */ |
||
57 | public function init(string $raw): iDokladModelInterface |
||
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getContent(): string |
||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getMime(): string |
||
85 | } |
||
86 |
If you suppress an error, we recommend checking for the error condition explicitly: