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

Project::getRootFolder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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