GroupTask   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
dl 0
loc 42
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A run() 0 4 1
A getGroup() 0 4 1
A local() 0 4 1
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Task;
9
10
use Deployer\Exception\Exception;
11
12
class GroupTask extends Task
13
{
14
    /**
15
     * List of tasks
16
     *
17
     * @var array
18
     */
19
    private $group;
20
21
    /**
22
     * @param string $name
23
     * @param array $group
24
     */
25 17
    public function __construct($name, $group)
26
    {
27 17
        parent::__construct($name);
28 17
        $this->group = $group;
29 17
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 1
    public function run(Context $context)
35
    {
36 1
        throw new \RuntimeException("Can't run group task.");
37
    }
38
39
    /**
40
     * List of dependent tasks names
41
     *
42
     * @return array
43
     */
44 9
    public function getGroup()
45
    {
46 9
        return $this->group;
47
    }
48
49
    public function local()
50
    {
51
        throw new Exception('Group tasks can\'t be local.');
52
    }
53
}
54