UnbundleCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 51
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFile() 0 4 1
A addFile() 0 4 1
A __toString() 0 9 1
1
<?php
2
/**
3
 * VersionControl_HG
4
 * Simple OO implementation for Mercurial.
5
 *
6
 * PHP Version 5.4
7
 *
8
 * @copyright 2014 Siad Ardroumli
9
 * @license http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link http://siad007.github.io/versioncontrol_hg
11
 */
12
13
namespace Siad007\VersionControl\HG\Command;
14
15
/**
16
 * Simple OO implementation for Mercurial.
17
 *
18
 * @author Siad Ardroumli <[email protected]>
19
 *
20
 * @method boolean getUpdate()
21
 * @method void setUpdate(boolean $flag)
22
 */
23
class UnbundleCommand extends AbstractCommand
24
{
25
    /**
26
     * Available arguments for this command.
27
     *
28
     * @var array $arguments
29
     */
30
    protected $arguments = [
31
        'file' => []
32
    ];
33
34
    /**
35
     * {@inheritdoc}
36
     *
37
     * @var mixed $options
38
     */
39
    protected $options = [
40
        '--update'    => false
41
    ];
42
43
    /**
44
     * @return array
45
     */
46 1
    public function getFile()
47
    {
48 1
        return $this->arguments['file'];
49
    }
50
51
    /**
52
     * @param string $file
53
     *
54
     * @return void
55
     */
56 1
    public function addFile($file)
57
    {
58 1
        $this->arguments['file'][] = escapeshellarg($file);
59 1
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64 1
    public function __toString()
65
    {
66 1
        return sprintf(
67 1
            "%s%s %s",
68 1
            $this->name,
69 1
            $this->assembleOptionString(),
70 1
            implode(' ', $this->arguments['file'])
71
        );
72
    }
73
}
74