Watchmaker   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 37
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfig() 0 3 1
A add() 0 3 1
A task() 0 3 1
A show() 0 5 1
A __construct() 0 3 1
A install() 0 5 1
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