JsonReporter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 25
ccs 0
cts 8
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A generate() 0 5 1
1
<?php
2
/**
3
 * This file is part of the Code-Insight library.
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @copyright Alexander Obuhovich <[email protected]>
8
 * @link      https://github.com/console-helpers/code-insight
9
 */
10
11
namespace ConsoleHelpers\CodeInsight\BackwardsCompatibility\Reporter;
12
13
14
use Camspiers\JsonPretty\JsonPretty;
15
16
class JsonReporter extends AbstractReporter
17
{
18
19
	/**
20
	 * Returns reporter name.
21
	 *
22
	 * @return string
23
	 */
24
	public function getName()
25
	{
26
		return 'json';
27
	}
28
29
	/**
30
	 * Generates report.
31
	 *
32
	 * @param array $bc_breaks BC breaks.
33
	 *
34
	 * @return string
35
	 */
36
	public function generate(array $bc_breaks)
37
	{
38
		$json_pretty = new JsonPretty();
39
40
		return $json_pretty->prettify($bc_breaks);
41
	}
42
43
}
44