Completed
Push — feature/allow-multi-docroots ( 0d353c )
by Matthias
10:05 queued 08:10
created

LegacyControllerOptions   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 75%

Importance

Changes 5
Bugs 3 Features 1
Metric Value
wmc 8
c 5
b 3
f 1
lcom 1
cbo 1
dl 0
loc 56
ccs 15
cts 20
cp 0.75
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocRoot() 0 4 1
A getDocRoots() 0 4 1
A getGlobals() 0 4 1
A setDocRoot() 0 7 2
A setGlobals() 0 4 1
A getIndexFiles() 0 4 1
A setIndexFiles() 0 4 1
1
<?php
2
3
/**
4
 * @author Matthias Glaub <[email protected]>
5
 * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
6
 */
7
8
namespace MaglLegacyApplication\Options;
9
10
class LegacyControllerOptions extends \Zend\Stdlib\AbstractOptions
11
{
12
13
    private $docRoot = array('public');
14
15
    private $indexFiles = array();
16
17
    private $globals = array(
18
        'get' => true,
19
        'request' => true,
20
    );
21
22 1
    public function getDocRoot()
23
    {
24 1
        return reset($this->docRoot);
25
    }
26
27 5
    public function getDocRoots()
28
    {
29 5
        return $this->docRoot;
30
    }
31
32 4
    public function getGlobals()
33
    {
34 4
        return $this->globals;
35
    }
36
37 6
    public function setDocRoot($docRoot)
38
    {
39 6
        if(!is_array($docRoot)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after IF keyword; 0 found
Loading history...
40 1
            $docRoot = array($docRoot);
41 1
        }
42 6
        $this->docRoot = $docRoot;
43 6
    }
44
45 5
    public function setGlobals($globals)
46
    {
47 5
        $this->globals = $globals;
48 5
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getIndexFiles()
54
    {
55
        return $this->indexFiles;
56
    }
57
58
    /**
59
     * @param array $indexFiles
60
     */
61
    public function setIndexFiles($indexFiles)
62
    {
63
        $this->indexFiles = $indexFiles;
64
    }
65
}
66