Manual   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setActive() 0 6 1
A isActive() 0 4 1
1
<?php
2
3
/*
4
 * janitor (http://juliangut.com/janitor).
5
 * Effortless maintenance management.
6
 *
7
 * @license BSD-3-Clause
8
 * @link https://github.com/juliangut/janitor
9
 * @author Julián Gutiérrez <[email protected]>
10
 */
11
12
namespace Janitor\Watcher;
13
14
/**
15
 * Manual maintenance status watcher.
16
 */
17
class Manual implements WatcherInterface
18
{
19
    /**
20
     * Maintenance mode active.
21
     *
22
     * @var bool
23
     */
24
    protected $active = false;
25
26
    /**
27
     * Manual constructor.
28
     *
29
     * @param bool $active
30
     */
31
    public function __construct($active = false)
32
    {
33
        $this->setActive($active);
34
    }
35
36
    /**
37
     * Set maintenance mode active.
38
     *
39
     * @param bool $active
40
     *
41
     * @return $this
42
     */
43
    public function setActive($active = true)
44
    {
45
        $this->active = (bool) $active;
46
47
        return $this;
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function isActive()
54
    {
55
        return $this->active;
56
    }
57
}
58