| Total Complexity | 2 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | class Diff extends Base |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * Returns a list of files and their changes. |
||
| 27 | * |
||
| 28 | * @param string $from |
||
| 29 | * @param string $to |
||
| 30 | * @return \SebastianFeldmann\Git\Diff\File[] |
||
| 31 | */ |
||
| 32 | 1 | public function compare(string $from, string $to): array |
|
| 33 | { |
||
| 34 | 1 | $compare = (new Compare($this->repo->getRoot()))->revisions($from, $to) |
|
| 35 | 1 | ->ignoreWhitespacesAtEndOfLine(); |
|
| 36 | |||
| 37 | 1 | $result = $this->runner->run($compare, new Compare\FullDiffList()); |
|
| 38 | |||
| 39 | 1 | return $result->getFormattedOutput(); |
|
|
|
|||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Uses 'diff-tree' to list the files that changed between two revisions |
||
| 44 | * |
||
| 45 | * @param string $from |
||
| 46 | * @param string $to |
||
| 47 | * @return string[] |
||
| 48 | */ |
||
| 49 | 1 | public function getChangedFiles(string $from, string $to): array |
|
| 55 | } |
||
| 56 | } |
||
| 57 |