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