Json   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 6 1
A format() 0 4 1
1
<?php
2
/**
3
 * @package    Fuel\Config
4
 * @version    2.0
5
 * @author     Fuel Development Team
6
 * @license    MIT License
7
 * @copyright  2010 - 2015 Fuel Development Team
8
 * @link       http://fuelphp.com
9
 */
10
11
namespace Fuel\Config\Handler;
12
13
use Fuel\Config\Handler;
14
15
/**
16
 * JSON configuration loading and formatting logic
17
 */
18
class Json implements Handler
19
{
20
	/**
21
	 * {@inheritdoc}
22
	 */
23 1
    public function load($file)
24
    {
25 1
        $contents = file_get_contents($file);
26
27 1
        return json_decode($contents, true);
28
    }
29
30
	/**
31
	 * {@inheritdoc}
32
	 */
33 1
    public function format($data)
34
    {
35 1
        return json_encode($data);
36
    }
37
}
38