Completed
Push — master ( ff4f9b...44b6f8 )
by Alexander
02:12
created

JsonReporter::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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