Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function archive(\SplFileInfo $file): string |
||
28 | { |
||
29 | $now = $this->now(); |
||
30 | $archivePath = $this->rootPath.'/'.$now->format('Y/m/d'); |
||
31 | $archiveFileName = $archivePath.'/'.$now->format('YmdHis').'_'.$file->getFilename(); |
||
32 | |||
33 | $filesystem = new Filesystem(); |
||
34 | $filesystem->mkdir($archivePath); |
||
35 | $filesystem->rename($file->getPathname(), $archiveFileName); |
||
36 | |||
37 | return $archiveFileName; |
||
38 | } |
||
45 |