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