Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function createUniqueName(Http\FileUpload $fileUpload) |
||
20 | { |
||
21 | $name = $fileUpload->getSanitizedName(); |
||
22 | |||
23 | //if we call moretimes, name is not unique, generate another one |
||
24 | if($this->called !== 0) { |
||
25 | $parts = pathinfo($name); |
||
26 | $name = $parts['filename'] . $this->called . '.' . $parts['extension']; |
||
27 | } |
||
28 | |||
29 | $this->called++; |
||
30 | return $name; |
||
31 | } |
||
32 | |||
35 | } |