Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function perform(): FileActionInterface |
||
24 | { |
||
25 | foreach ($this->iterator as $file) { |
||
26 | $fullFile = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename(); |
||
27 | $this->deletedFiles[] = $fullFile; |
||
28 | $this->logger->info('Removing', ['file' => $fullFile, 'dry-run' => $this->isTestMode]); |
||
29 | if ($this->isTestMode === false) { |
||
30 | if ($file->isDir()) { |
||
31 | rmdir($fullFile); |
||
32 | } else { |
||
33 | unlink($fullFile); |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | |||
38 | return $this; |
||
39 | } |
||
40 | } |
||
41 |