1 | <?php |
||
17 | class Index extends Base |
||
18 | { |
||
19 | /** |
||
20 | * List of changed files. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | private $files; |
||
25 | |||
26 | /** |
||
27 | * Changed files by file type |
||
28 | * |
||
29 | * @var array[] |
||
30 | */ |
||
31 | private $types = []; |
||
32 | |||
33 | /** |
||
34 | * Files sorted by suffix yet |
||
35 | * |
||
36 | * @var bool |
||
37 | */ |
||
38 | private $typesResolved = false; |
||
39 | |||
40 | /** |
||
41 | * Get the lst of files that changed. |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 4 | public function getStagedFiles() : array |
|
52 | |||
53 | /** |
||
54 | * Where there files changed of a given type. |
||
55 | * |
||
56 | * @param string $suffix |
||
57 | * @return bool |
||
58 | */ |
||
59 | 1 | public function hasStagedFilesOfType($suffix) : bool |
|
63 | |||
64 | /** |
||
65 | * Return list of changed files of a given type. |
||
66 | * |
||
67 | * @param string $suffix |
||
68 | * @return array |
||
69 | */ |
||
70 | 2 | public function getStagedFilesOfType($suffix) : array |
|
77 | |||
78 | /** |
||
79 | * Resolve the list of files that changed. |
||
80 | */ |
||
81 | 4 | private function resolveFiles() |
|
92 | |||
93 | /** |
||
94 | * Sort files by file suffix. |
||
95 | */ |
||
96 | 2 | private function resolveFileTypes() |
|
104 | |||
105 | /** |
||
106 | * Check head validity. |
||
107 | * |
||
108 | * @return bool |
||
109 | */ |
||
110 | 4 | private function isHeadValid() : bool |
|
120 | } |
||
121 |