Xhgui_Saver_File::__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
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