Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | public static function uploadedFile($filePath, $originalName = null) |
||
10 | { |
||
11 | $tmpFilePath = tempnam(sys_get_temp_dir(), 'alice-'); |
||
12 | copy($filePath, $tmpFilePath); |
||
13 | |||
14 | if (null === $originalName) { |
||
15 | $originalName = basename($filePath); |
||
16 | } |
||
17 | |||
18 | //TODO: register shutdown function for removing |
||
19 | |||
20 | return new UploadedFile($tmpFilePath, $originalName, null, null, null, true); |
||
21 | } |
||
22 | } |
||
23 |