1 | <?php |
||
12 | class DiffOutputFilter implements OutputFilterInterface |
||
13 | { |
||
14 | /** |
||
15 | * Root path to which the diff file paths are relative. |
||
16 | * @var string root path. |
||
17 | */ |
||
18 | protected $root; |
||
19 | |||
20 | /** |
||
21 | * An array of Diff objects. |
||
22 | * @var SebastianBergmann\Diff\Diff[] array of diff objects. |
||
23 | */ |
||
24 | protected $diffs; |
||
25 | |||
26 | /** |
||
27 | * Constructor. |
||
28 | * @param string $root root path. |
||
29 | * @param SebastianBergmann\Diff\Diff[] $diffs array of diff objects. |
||
30 | */ |
||
31 | public function __construct($root, array $diffs) |
||
36 | |||
37 | /** |
||
38 | * @inheritdoc |
||
39 | */ |
||
40 | public function filter($data) |
||
60 | |||
61 | /** |
||
62 | * Files touched by the diff and that received at least one new line of code. |
||
63 | * @return string[] files paths. |
||
64 | */ |
||
65 | public function getFilesWithAddedCode() |
||
73 | |||
74 | /** |
||
75 | * Gets the list of files and lines touched by the diff. |
||
76 | * @return array where the key is the file path and its values the lines. |
||
77 | */ |
||
78 | protected function getTouchedFilesAndLines() |
||
102 | |||
103 | /** |
||
104 | * Search for diffs where at least one line of code was added. |
||
105 | * @return SebastianBergmann\Diff\Diff[] diffs adding code. |
||
106 | */ |
||
107 | protected function getDiffsWithAddedCode() |
||
122 | } |
||
123 |