Logger::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
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)
14
    {
15
        file_put_contents(self::$instance->logFile, $text, FILE_APPEND);
16
    }
17
18
19
20
    static public function setup($path)
21
    {
22
        self::$instance = new self($path);
23
    }
24
25
26
27
    private function __construct($path)
28
    {
29
        $this->logFile = $path;
30
    }
31
}