Completed
Push — master ( e41e91...2b4213 )
by Aleh
01:47 queued 01:39
created

Project   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
c 1
b 0
f 0
lcom 2
cbo 0
dl 0
loc 48
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRootFolder() 0 4 1
A getRootDir() 0 4 1
A getIndex() 0 4 1
A setIndex() 0 4 1
A getPlugins() 0 4 1
A addPlugin() 0 4 1
A getPlugin() 0 7 2
1
<?php
2
3
namespace Padawan\Domain;
4
5
use Padawan\Domain\Project\Index;
6
7
class Project
8
{
9
    private $index;
10
    private $rootFolder;
11
    private $plugins = [];
12
13
    public function __construct(Index $index, $rootFolder = "")
14
    {
15
        $this->index        = $index;
16
        $this->rootFolder   = $rootFolder;
17
    }
18
    public function getRootFolder()
19
    {
20
        return $this->rootFolder;
21
    }
22
    public function getRootDir()
23
    {
24
        return $this->getRootFolder();
25
    }
26
27
    /**
28
     * Returns project's index
29
     * @return Index
30
     */
31
    public function getIndex()
32
    {
33
        return $this->index;
34
    }
35
    public function setIndex(Index $index)
36
    {
37
        $this->index = $index;
38
    }
39
    public function getPlugins()
40
    {
41
        return $this->plugins;
42
    }
43
    public function addPlugin($key, $plugin)
44
    {
45
        $this->plugins[$key] = $plugin;
46
    }
47
    public function getPlugin($key)
48
    {
49
        if (array_key_exists($key, $this->plugins)) {
50
            return $this->plugins[$key];
51
        }
52
        return [];
53
    }
54
}
55