1 | <?php |
||
10 | abstract class Task |
||
11 | { |
||
12 | /** |
||
13 | * @var ProcessRunner |
||
14 | */ |
||
15 | protected $processRunner; |
||
16 | |||
17 | /** |
||
18 | * @param OutputInterface $output |
||
19 | * @param bool $dryRun |
||
20 | */ |
||
21 | abstract public function run(OutputInterface $output, $dryRun); |
||
22 | |||
23 | /** |
||
24 | * @param OutputInterface $output |
||
25 | * @param string $command Command to check whether a problem exists |
||
26 | * @param string $workingMessage Output when the command passes |
||
27 | * @param string $problem Problem description |
||
28 | * @param string $suggestedSolution Suggested solution |
||
29 | * @param Installable $installable Task to fix the problem |
||
30 | * @param bool $dryRun Try to fix the problem? |
||
31 | * |
||
32 | * @throws CommandFailedException |
||
33 | */ |
||
34 | protected function handle(OutputInterface $output, $command, $workingMessage, $problem, $suggestedSolution, Installable $installable, $dryRun) |
||
52 | |||
53 | /** |
||
54 | * @param string $command |
||
55 | * |
||
56 | * @return bool Did the command succeed? |
||
57 | */ |
||
58 | protected function testCommand($command) |
||
68 | } |
||
69 |