1 | <?php declare(strict_types = 1); |
||
21 | class ChurnCommand extends Command |
||
22 | { |
||
23 | /** |
||
24 | * The config values. |
||
25 | * @var Config |
||
26 | */ |
||
27 | private $config; |
||
28 | |||
29 | /** |
||
30 | * The process factory. |
||
31 | * @var ProcessFactory |
||
32 | */ |
||
33 | private $processFactory; |
||
34 | |||
35 | /** |
||
36 | * Th results parser. |
||
37 | * @var ResultsParser |
||
38 | */ |
||
39 | private $resultsParser; |
||
40 | |||
41 | /** |
||
42 | * Collection of files to run the processes on. |
||
43 | * @var FileCollection |
||
44 | */ |
||
45 | private $filesCollection; |
||
46 | |||
47 | /** |
||
48 | * Collection of processes currently running. |
||
49 | * @var Collection |
||
50 | */ |
||
51 | private $runningProcesses; |
||
52 | |||
53 | /** |
||
54 | * Array of completed processes. |
||
55 | * @var array |
||
56 | */ |
||
57 | private $completedProcessesArray; |
||
58 | |||
59 | /** |
||
60 | * The start time. |
||
61 | * @var float |
||
62 | */ |
||
63 | private $startTime; |
||
64 | |||
65 | /** |
||
66 | * Keeps track of how many files were processed. |
||
67 | * @var integer |
||
68 | */ |
||
69 | private $filesCount; |
||
70 | |||
71 | /** |
||
72 | * ChurnCommand constructor. |
||
73 | */ |
||
74 | public function __construct() |
||
80 | |||
81 | /** |
||
82 | * Configure the command |
||
83 | * @return void |
||
84 | */ |
||
85 | protected function configure() |
||
93 | |||
94 | /** |
||
95 | * Execute the command |
||
96 | * @param InputInterface $input Input. |
||
97 | * @param OutputInterface $output Output. |
||
98 | * @return void |
||
99 | */ |
||
100 | protected function execute(InputInterface $input, OutputInterface $output) |
||
119 | |||
120 | /** |
||
121 | * Gets the output from processes and stores them in the completedProcessArray member. |
||
122 | * @return void |
||
123 | */ |
||
124 | private function getProcessResults() |
||
145 | |||
146 | /** |
||
147 | * Displays the results in a table. |
||
148 | * @param OutputInterface $output Output. |
||
149 | * @param ResultCollection $results Results Collection. |
||
150 | * @return void |
||
151 | */ |
||
152 | protected function displayResults(OutputInterface $output, ResultCollection $results) |
||
173 | |||
174 | /** |
||
175 | * @param string $configFile Relative path churn.yml configuration file. |
||
176 | * @return void |
||
177 | */ |
||
178 | private function setupProcessor(string $configFile) |
||
183 | |||
184 | /** |
||
185 | * @param array $directory Directories. |
||
186 | * @return FileCollection |
||
187 | */ |
||
188 | private function getPhpFiles(array $directory): FileCollection |
||
194 | |||
195 | private function getDirectoriesToScan(InputInterface $input) |
||
212 | } |
||
213 |