1 | <?php |
||
8 | class File extends Attachment |
||
9 | { |
||
10 | /** |
||
11 | * @var string|null |
||
12 | */ |
||
13 | private $path; |
||
14 | |||
15 | /** |
||
16 | * @var bool |
||
17 | */ |
||
18 | private $isRemoteFile; |
||
19 | |||
20 | /** |
||
21 | * @var null|resource |
||
22 | */ |
||
23 | private $stream; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $allowedExtensions = []; |
||
29 | |||
30 | /** |
||
31 | * @param string $type |
||
32 | * @param string $filePath |
||
33 | */ |
||
34 | 19 | public function __construct($filePath, $type = Attachment::TYPE_FILE) |
|
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getPath() |
|
59 | |||
60 | 3 | public function open() |
|
80 | |||
81 | /** |
||
82 | * @return null|resource |
||
83 | */ |
||
84 | 1 | public function getStream() |
|
90 | |||
91 | /** |
||
92 | * @return bool |
||
93 | */ |
||
94 | 19 | public function isRemoteFile() |
|
102 | |||
103 | 19 | private function validateExtension() |
|
111 | } |
||
112 |