Completed
Push — cecil ( fdb5cb )
by Arnaud
02:34
created

Clean::processCommand()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 3
nc 4
nop 0
1
<?php
2
/*
3
 * This file is part of the Cecil/Cecil package.
4
 *
5
 * Copyright (c) Arnaud Ligny <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Cecil\Command;
12
13
class Clean extends AbstractCommand
14
{
15
    public function processCommand()
16
    {
17
        //delete output dir
18
        $outputDir = $this->getPHPoole()->getConfig()->get('output.dir');
19
        if ($this->fs->exists($this->getPath().'/'.$outputDir)) {
20
            $this->fs->remove($this->getPath().'/'.$outputDir);
21
            $this->wlDone(sprintf("Output directory '%s' removed.", $outputDir));
22
        }
23
        // delete server temp files
24
        if ($this->fs->exists($this->getPath().'/'.Serve::$tmpDir)) {
25
            $this->fs->remove($this->getPath().'/'.Serve::$tmpDir);
26
            $this->wlDone('Temporary server files deleted.');
27
        }
28
        exit(0);
29
    }
30
}
31