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

Clean   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 5
dl 0
loc 18
rs 10
c 0
b 0
f 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