Watchmaker::task()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
namespace Watchmaker;
4
5
use Watchmaker\task\Install;
6
use Watchmaker\task\Show;
7
8
class Watchmaker
9
{
10
    private static $config;
11
    private $taskList = [];
12
13
    public function __construct(Config $config)
14
    {
15
        self::$config = $config;
16
    }
17
18
    public function task($command = '')
19
    {
20
        return new WatchmakerCore($command);
21
    }
22
23
    public function add(WatchmakerCore $kairos)
24
    {
25
        $this->taskList[] = $kairos;
26
    }
27
28
    public function show()
29
    {
30
        $show = new Show();
31
32
        return $show->execute($this->taskList);
33
    }
34
35
    public function install()
36
    {
37
        $install = new Install();
38
39
        return $install->execute($this->taskList);
40
    }
41
42
    public static function getConfig() : Config
43
    {
44
        return self::$config;
45
    }
46
}
47