System   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 6 1
A write() 0 10 2
1
<?php
2
3
namespace Subreality\Dilmun\Nabu\LoggerHandler;
4
5
/**
6
 * Class System
7
 *
8
 * Simple log handler that writes to the system log using error_log.
9
 *
10
 * @package Subreality\Dilmun\Nabu\LoggerHandler
11
 *
12
 * @see error_log()
13
 */
14
class System extends AbstractHandler
15
{
16
    /**
17
     * @return bool
18
     */
19 1
    public function initialize()
20
    {
21 1
        $initialize_status = error_log("Initializing System logger.");
22
23 1
        return $initialize_status;
24
    }
25
26
    /**
27
     * Writes to the configured PHP error logger.
28
     *
29
     * @see error_log()
30
     *
31
     * @param string $message   Message to be written to PHP's system log
32
     * @return bool             Returns the status from the error_log function
33
     */
34 23
    public function write($message)
35
    {
36 23
        $written = false;
37
38 23
        if ($this->output_allowed) {
39 22
            $written = error_log($message);
40 22
        }
41
42 23
        return $written;
43
    }
44
}
45