1 | <?php |
||
11 | class UploadedFiles |
||
12 | { |
||
13 | public function count() |
||
17 | |||
18 | public function getKeys() |
||
22 | |||
23 | public function isOk($key) |
||
27 | |||
28 | public function getUploadedFile($key) |
||
32 | |||
33 | public function getFileName($key) |
||
37 | |||
38 | public function getFileType($key) |
||
42 | |||
43 | public function saveTo($key, $destinationPath, $newName = "") |
||
51 | |||
52 | public function clearTemp($key) |
||
56 | |||
57 | private function getFileByKey($key, $property) |
||
65 | } |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: