1 | <?php |
||
8 | class UploadeFile |
||
9 | { |
||
10 | /** |
||
11 | * Application Object |
||
12 | * |
||
13 | * @var \System\Application |
||
14 | */ |
||
15 | private $app; |
||
16 | |||
17 | /** |
||
18 | * File |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | private $file = []; |
||
23 | |||
24 | /** |
||
25 | * File Name |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | private $fileName; |
||
30 | |||
31 | /** |
||
32 | * File Name |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $nameOnly; |
||
37 | |||
38 | /** |
||
39 | * File Extension |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $extension; |
||
44 | |||
45 | /** |
||
46 | * File Minetype |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | private $minetype; |
||
51 | |||
52 | /** |
||
53 | * File Temp |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | private $tempFile; |
||
58 | |||
59 | /** |
||
60 | * File Size |
||
61 | * |
||
62 | * @var string |
||
63 | */ |
||
64 | private $size; |
||
65 | |||
66 | /** |
||
67 | * File Error |
||
68 | * |
||
69 | * @var string |
||
70 | */ |
||
71 | private $error; |
||
72 | |||
73 | /** |
||
74 | * Constructor |
||
75 | * |
||
76 | * @param \System\Application $app |
||
77 | * @param $file |
||
78 | */ |
||
79 | public function __construct(Application $app) |
||
83 | |||
84 | /** |
||
85 | * Recive the file key |
||
86 | * |
||
87 | * @param string $file |
||
88 | * @return object $this; |
||
89 | */ |
||
90 | public function file(string $file) |
||
96 | |||
97 | /** |
||
98 | * Set the variables |
||
99 | * |
||
100 | * @property object $request |
||
101 | * @param string $file |
||
102 | * @return void |
||
103 | */ |
||
104 | private function setFileInfo($file) |
||
128 | |||
129 | /** |
||
130 | * Get file name |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getFileName() |
||
138 | |||
139 | /** |
||
140 | * Get file name only |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | public function getNameOnly() |
||
148 | |||
149 | /** |
||
150 | * Get extension |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function getExtension() |
||
158 | |||
159 | /** |
||
160 | * Get minetype |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | public function getMinetype() |
||
168 | |||
169 | /** |
||
170 | * Get size |
||
171 | * |
||
172 | * @return string |
||
173 | */ |
||
174 | public function getSize() |
||
178 | |||
179 | /** |
||
180 | * Get temp file |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | public function getTempFile() |
||
188 | |||
189 | /** |
||
190 | * Move file to the geven target |
||
191 | * |
||
192 | * @param string $target |
||
193 | * @param string $newName |
||
194 | * @return bool |
||
195 | */ |
||
196 | public function moveTo(string $target, string $newName = null) |
||
211 | } |
||
212 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.