Completed
Push — master ( aa6cf8...986e1b )
by Alexander
02:21
created

Logger   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 27
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A log() 0 4 1
A setup() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
namespace EmberDb;
4
5
class Logger
6
{
7
    static private $instance = null;
8
9
    public $logFile;
10
11
12
13
    static public function log($text)
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
14
    {
15
        file_put_contents(self::$instance->logFile, $text, FILE_APPEND);
16
    }
17
18
19
20
    static public function setup($path)
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
21
    {
22
        self::$instance = new self($path);
23
    }
24
25
26
27
    private function __construct($path)
28
    {
29
        $this->logFile = $path;
30
    }
31
}