Completed
Push — master ( 44198b...431447 )
by Derek
03:47 queued 01:34
created

AbstractHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 22
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
    abstract public function initialize();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
13
14
    /**
15
     * @param string $message
16
     * @return bool
17
     */
18
    abstract public function write($message);
19
20 2
    public function allowOutput()
21
    {
22 2
        $this->output_allowed = true;
23 2
    }
24
25 4
    public function suppressOutput()
26
    {
27 4
        $this->output_allowed = false;
28 4
    }
29
}
30