Php   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
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 32
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 4 1
A format() 0 18 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
 * PHP configuration loading and formatting logic
17
 */
18
class Php implements Handler
19
{
20
	/**
21
	 * {@inheritdoc}
22
	 */
23 4
	public function load($file)
24
	{
25 4
		return include $file;
26
	}
27
28
	/**
29
	 * {@inheritdoc}
30
	 */
31 2
	public function format($data)
32
	{
33 2
		$data = var_export($data, true);
34
35 2
		$formatted = str_replace(
36 2
			array('  ', 'array ('),
37 2
			array("\t", 'array('),
38
			$data
39
		);
40
41
		$output = <<<CONF
42
<?php
43
44 2
return {$formatted};
45
CONF;
46
47 2
		return $output;
48
	}
49
}
50