json_reader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 11
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_datas() 0 2 1
A set_file() 0 3 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
}