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

Logger::log()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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