json_reader::set_file()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * © 2018 - Phoponent
5
 * Author: Nicolas Choquet
6
 * Email: [email protected]
7
 * LICENSE GPL ( GNU General Public License )
8
 */
9
10
namespace phoponent\framework\service;
11
12
use phoponent\framework\traits\service;
13
14
class json_reader {
15
	use service;
16
	protected $file = '';
17
18
	public function set_file($file) {
19
		$this->file = "$file.json";
20
		return $this;
21
	}
22
23
	public function get_datas() {
24
		return json_decode(file_get_contents($this->file));
25
	}
26
}