AbstractHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 31
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0
ccs 6
cts 6
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
initialize() 0 1 ?
write() 0 1 ?
A allowOutput() 0 4 1
A suppressOutput() 0 4 1
1
<?php
2
namespace Subreality\Dilmun\Nabu\LoggerHandler;
3
4
/**
5
 * Class AbstractHandler
6
 * @package Subreality\Dilmun\Nabu\LoggerHandler
7
 */
8
abstract class AbstractHandler implements HandlerInterface
9
{
10
    protected $output_allowed = true;
11
12
    /**
13
     * @return bool
14
     */
15
    abstract public function initialize();
16
17
    /**
18
     * @param string $message
19
     * @return bool
20
     */
21
    abstract public function write($message);
22
23
    /**
24
     * @return void
25
     */
26 2
    public function allowOutput()
27
    {
28 2
        $this->output_allowed = true;
29 2
    }
30
31
    /**
32
     * @return void
33
     */
34 4
    public function suppressOutput()
35
    {
36 4
        $this->output_allowed = false;
37 4
    }
38
}
39