Completed
Push — master ( 0ab6a2...d8ddb3 )
by Robbie
01:17
created

AbstractTaskCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 31
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTask() 0 4 1
A setTask() 0 5 1
1
<?php
2
3
namespace SilverLeague\Console\Command\Dev\Tasks;
4
5
use SilverLeague\Console\Command\SilverStripeCommand;
6
use SilverStripe\Dev\BuildTask;
7
8
/**
9
 * Not an actual abstract class, but used by the Command Factory to create Commands from BuildTasks
10
 *
11
 * @package silverstripe-console
12
 * @author  Robbie Averill <[email protected]>
13
 */
14
class AbstractTaskCommand extends SilverStripeCommand
15
{
16
    /**
17
     * Contains the SilverStripe BuildTask used for this command, if imported from SilverStripe
18
     *
19
     * @var BuildTask
20
     */
21
    protected $buildTask;
22
23
    /**
24
     * Get the original SilverStrpe BuildTask used
25
     *
26
     * @return BuildTask
27
     */
28
    public function getTask()
29
    {
30
        return $this->buildTask;
31
    }
32
33
    /**
34
     * Set the original SilverStripe BuildTask used
35
     *
36
     * @param  BuildTask $task
37
     * @return $this
38
     */
39 2
    public function setTask(BuildTask $task)
40
    {
41 2
        $this->buildTask = $task;
42 2
        return $this;
43
    }
44
}
45