| Total Complexity | 11 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class UploadedFiles |
||
| 8 | { |
||
| 9 | public function count() |
||
| 10 | { |
||
| 11 | return count($_FILES); |
||
| 12 | } |
||
| 13 | |||
| 14 | public function getKeys() |
||
| 15 | { |
||
| 16 | return array_keys($_FILES); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function isOk($key) |
||
| 20 | { |
||
| 21 | return $this->getFileByKey($key, 'error'); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function getUploadedFile($key) |
||
| 25 | { |
||
| 26 | return file_get_contents($this->getFileByKey($key, 'tmp_name')); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getFileName($key) |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getFileType($key) |
||
| 35 | { |
||
| 36 | return $this->getFileByKey($key, 'type'); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function saveTo($key, $destinationPath, $newName = "") |
||
| 46 | } |
||
| 47 | |||
| 48 | public function clearTemp($key) |
||
| 49 | { |
||
| 50 | unlink($this->getFileByKey($key, 'tmp_name')); |
||
| 51 | } |
||
| 52 | |||
| 53 | private function getFileByKey($key, $property) |
||
| 60 | } |
||
| 61 | } |
||
| 62 |