Completed
Push — cecil ( 66a45a )
by Arnaud
02:09
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 Method

Rating   Name   Duplication   Size   Complexity  
A processCommand() 0 15 3
1
<?php
2
/*
3
 * This file is part of the PHPoole/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
use PHPoole\PHPoole;
14
15
class Clean extends AbstractCommand
16
{
17
    public function processCommand()
18
    {
19
        //delete output dir
20
        $outputDir = $this->getPHPoole()->getConfig()->get('output.dir');
21
        if ($this->fs->exists($this->getPath().'/'.$outputDir)) {
22
            $this->fs->remove($this->getPath().'/'.$outputDir);
23
            $this->wlDone(sprintf("Output directory '%s' removed.", $outputDir));
24
        }
25
        // delete server temp files
26
        if ($this->fs->exists($this->getPath().'/'.Serve::$tmpDir)) {
27
            $this->fs->remove($this->getPath().'/'.Serve::$tmpDir);
28
            $this->wlDone('Temporary server files deleted.');
29
        }
30
        exit(0);
31
    }
32
}
33