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