1 | <?php |
||
12 | class DiffOutputFilter implements OutputFilterInterface |
||
13 | { |
||
14 | /** |
||
15 | * Root path to which the diff file paths are relative. |
||
16 | * |
||
17 | * @var string root path. |
||
18 | */ |
||
19 | protected $root; |
||
20 | |||
21 | /** |
||
22 | * An array of Diff objects. |
||
23 | * |
||
24 | * @var SebastianBergmann\Diff\Diff[] array of diff objects. |
||
25 | */ |
||
26 | protected $diffs; |
||
27 | |||
28 | /** |
||
29 | * Constructor. |
||
30 | * |
||
31 | * @param string $root root path. |
||
32 | * @param SebastianBergmann\Diff\Diff[] $diffs array of diff objects. |
||
33 | */ |
||
34 | public function __construct($root, array $diffs) |
||
39 | |||
40 | /** |
||
41 | * @inheritdoc |
||
42 | */ |
||
43 | public function filter($data) |
||
63 | |||
64 | /** |
||
65 | * Files touched by the diff and that received at least one new line of code. |
||
66 | * |
||
67 | * @return string[] files paths. |
||
68 | */ |
||
69 | public function getFilesWithAddedCode() |
||
77 | |||
78 | /** |
||
79 | * Gets the list of files and lines touched by the diff. |
||
80 | * |
||
81 | * @return array where the key is the file path and its values the lines. |
||
82 | */ |
||
83 | protected function getTouchedFilesAndLines() |
||
107 | |||
108 | /** |
||
109 | * Search for diffs where at least one line of code was added. |
||
110 | * |
||
111 | * @return SebastianBergmann\Diff\Diff[] diffs adding code. |
||
112 | */ |
||
113 | protected function getDiffsWithAddedCode() |
||
128 | } |
||
129 |