ModuleOptions   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 2
cbo 1
dl 0
loc 60
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplateMap() 0 7 2
A setTemplateMap() 0 5 1
A getPhpErrorLog() 0 5 2
A setPhpErrorLog() 0 5 1
1
<?php
2
/**
3
 * Webino (http://webino.sk/)
4
 *
5
 * @link        https://github.com/webino/WebinoDebug/ for the canonical source repository
6
 * @copyright   Copyright (c) 2014-2018 Webino, s. r. o. (http://webino.sk/)
7
 * @license     BSD-3-Clause
8
 */
9
10
namespace WebinoDebug\Options;
11
12
/**
13
 * WebinoDebug module options
14
 */
15
class ModuleOptions extends DebuggerOptions
16
{
17
    /**
18
     * @var array|null
19
     */
20
    protected $templateMap;
21
22
    /**
23
     * @var string|null
24
     */
25
    protected $phpErrorLog;
26
27
    /**
28
     * Return view template map
29
     *
30
     * @return array
31
     */
32
    public function getTemplateMap()
33
    {
34
        if (null === $this->templateMap) {
35
            $this->setTemplateMap(['error/index' => __DIR__ . '/../../../view/error/index.phtml']);
36
        }
37
        return $this->templateMap;
38
    }
39
40
    /**
41
     * Configure view templates
42
     *
43
     * @param array|null $templateMap Empty array to disable, null for default
44
     * @return $this
45
     */
46
    public function setTemplateMap(array $templateMap = null)
47
    {
48
        $this->templateMap = $templateMap;
49
        return $this;
50
    }
51
52
    /**
53
     * Return PHP error log file path
54
     *
55
     * @return string
56
     */
57
    public function getPhpErrorLog()
58
    {
59
        $this->phpErrorLog or $this->phpErrorLog = parent::getLog() . '/php.log';
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getLog() instead of getPhpErrorLog()). Are you sure this is correct? If so, you might want to change this to $this->getLog().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
60
        return $this->phpErrorLog;
61
    }
62
63
    /**
64
     * Set PHP error log file path
65
     *
66
     * @param string|null $phpErrorLog
67
     * @return $this
68
     */
69
    public function setPhpErrorLog(string $phpErrorLog = null)
70
    {
71
        $this->phpErrorLog = $phpErrorLog;
72
        return $this;
73
    }
74
}
75