Completed
Push — master ( a14137...ece60e )
by personal
10s
created

TemplateConfiguration::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
dl 0
loc 5
rs 9.4285
c 2
b 0
f 2
cc 3
eloc 3
nc 4
nop 1
1
<?php
2
3
/*
4
 * (c) Jean-Fran�ois L�pine <https://twitter.com/Halleck45>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Hal\Application\Config;
11
12
/**
13
 * Template configuration
14
 *
15
 * @author Ramunas Geciauskas <[email protected]>
16
 */
17
class TemplateConfiguration
18
{
19
    /**
20
     * @var string Template title name
21
     */
22
    private $title;
23
24
    /**
25
     * @var bool
26
     */
27
    private $offline;
28
29
    /**
30
     * @param array $defaults Default settings
31
     */
32
    public function __construct(array $defaults = array())
33
    {
34
        $this->title = empty($defaults['title']) ? 'PhpMetrics report' : $defaults['title'];
35
        $this->offline = isset($defaults['offline']) ? (bool) $defaults['offline'] : false;
36
    }
37
38
    /**
39
     * @param string $title
40
     * @return self
41
     */
42
    public function setTitle($title)
43
    {
44
        $this->title = $title;
45
        return $this;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getTitle()
52
    {
53
        return $this->title;
54
    }
55
56
    /**
57
     * @return boolean
58
     */
59
    public function isOffline()
60
    {
61
        return $this->offline;
62
    }
63
64
    /**
65
     * @param boolean $offline
66
     * @return self
67
     */
68
    public function setOffline($offline)
69
    {
70
        $this->offline = (bool) $offline;
71
        return $this;
72
    }
73
74
}