Conditions | 4 |
Paths | 8 |
Total Lines | 19 |
Lines | 11 |
Ratio | 57.89 % |
Changes | 0 |
1 | <?php |
||
31 | protected function execute(InputInterface $input, OutputInterface $output) |
||
32 | { |
||
33 | $outputDir = $this->getBuilder($output)->getConfig()->get('output.dir'); |
||
34 | View Code Duplication | if ($this->fs->exists($this->getPath() . '/' . Serve::$tmpDir . '/output')) { |
|
|
|||
35 | $outputDir = file_get_contents($this->getPath() . '/' . Serve::$tmpDir . '/output'); |
||
36 | } |
||
37 | // delete output dir |
||
38 | View Code Duplication | if ($this->fs->exists($this->getPath() . '/' . $outputDir)) { |
|
39 | $this->fs->remove($this->getPath() . '/' . $outputDir); |
||
40 | $output->writeln(sprintf("Output directory '%s' removed.", $outputDir)); |
||
41 | } |
||
42 | // delete local server temp files |
||
43 | View Code Duplication | if ($this->fs->exists($this->getPath() . '/' . Serve::$tmpDir)) { |
|
44 | $this->fs->remove($this->getPath() . '/' . Serve::$tmpDir); |
||
45 | $output->writeln('Temporary files deleted.'); |
||
46 | } |
||
47 | |||
48 | return 0; |
||
49 | } |
||
50 | } |
||
51 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.