Logger   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

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)
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
}