Completed
Push — master ( c52c5c...9fd6d3 )
by
unknown
19s queued 10s
created

DebugAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setDebug() 0 4 1
A debug() 0 4 1
1
<?php
2
3
namespace Charcoal\App;
4
5
/**
6
 * Provides an application template/action with the ability to determine the debug mode.
7
 */
8
trait DebugAwareTrait
9
{
10
    /**
11
     * Whether the debug mode is enabled.
12
     *
13
     * @var boolean
14
     */
15
    private $debug = false;
16
17
    /**
18
     * Set application debug mode.
19
     *
20
     * @param  boolean $debug The debug flag.
21
     * @return void
22
     */
23
    protected function setDebug($debug)
24
    {
25
        $this->debug = !!$debug;
26
    }
27
28
    /**
29
     * Retrieve the application debug mode.
30
     *
31
     * @return boolean
32
     */
33
    public function debug()
34
    {
35
        return $this->debug;
36
    }
37
}
38