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

AbstractHandler::allowOutput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
nc 1
cc 1
eloc 2
nop 0
crap 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