Xhgui_Saver_File   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A save() 0 5 1
1
<?php
2
3
class Xhgui_Saver_File implements Xhgui_Saver_Interface
4
{
5
    private $_file;
6
7
    public function __construct($file)
8
    {
9
        $this->_file = $file;
10
    }
11
12
    public function save(array $data)
13
    {
14
        $json = json_encode($data);
15
        return file_put_contents($this->_file, $json.PHP_EOL, FILE_APPEND);
16
    }
17
}
18