1 | <?php |
||
35 | abstract class AbstractComposerCommandTask extends Task |
||
36 | { |
||
37 | /** |
||
38 | * Prepare the Command instance to execute. |
||
39 | * |
||
40 | * @return BaseCommand |
||
41 | */ |
||
42 | abstract protected function prepareCommand(); |
||
43 | |||
44 | /** |
||
45 | * Prepare the input interface for the command. |
||
46 | * |
||
47 | * @return InputInterface |
||
48 | */ |
||
49 | abstract protected function prepareInput(); |
||
50 | |||
51 | /** |
||
52 | * Add missing definition options to the command usually defined by the application. |
||
53 | * |
||
54 | * See also composer/composer in src/Composer/Console/Application.php |
||
55 | * |
||
56 | * @param BaseCommand $command The command to fix. |
||
57 | * |
||
58 | * @return void |
||
59 | */ |
||
60 | protected function fixCommandDefinition(BaseCommand $command) |
||
105 | |||
106 | /** |
||
107 | * Attach the composer factory to the command. |
||
108 | * |
||
109 | * @param BaseCommand $command The command to patch. |
||
110 | * |
||
111 | * @return BaseCommand |
||
|
|||
112 | * |
||
113 | * @throws \InvalidArgumentException When no setComposerFactory method is declared. |
||
114 | */ |
||
115 | protected function attachComposerFactory(BaseCommand $command) |
||
130 | |||
131 | /** |
||
132 | * Execute the command and throw exceptions on errors. |
||
133 | * |
||
134 | * @param BaseCommand $command The command to execute. |
||
135 | * |
||
136 | * @param InputInterface $input The input to use. |
||
137 | * |
||
138 | * @param OutputInterface $output The output to use. |
||
139 | * |
||
140 | * @return void |
||
141 | * |
||
142 | * @throws \RuntimeException On exceptions or when the command has an non zero exit code. |
||
143 | */ |
||
144 | protected function executeCommand(BaseCommand $command, InputInterface $input, OutputInterface $output) |
||
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | * |
||
158 | * @return void |
||
159 | */ |
||
160 | public function doPerform() |
||
168 | } |
||
169 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.