1 | <?php |
||
35 | abstract class AbstractComposerCommandTask extends Task |
||
36 | { |
||
37 | /** |
||
38 | * Prepare the Command instance to execute. |
||
39 | * |
||
40 | * @return Command |
||
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 | * @param Command $command The command to fix. |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | protected function fixCommandDefinition(Command $command) |
||
73 | |||
74 | /** |
||
75 | * Attach the composer factory to the command. |
||
76 | * |
||
77 | * @param Command $command The command to patch. |
||
78 | * |
||
79 | * @return Command |
||
|
|||
80 | * |
||
81 | * @throws \InvalidArgumentException When no setComposerFactory method is declared. |
||
82 | */ |
||
83 | protected function attachComposerFactory(Command $command) |
||
98 | |||
99 | /** |
||
100 | * Execute the command and throw exceptions on errors. |
||
101 | * |
||
102 | * @param Command $command The command to execute. |
||
103 | * |
||
104 | * @param InputInterface $input The input to use. |
||
105 | * |
||
106 | * @param OutputInterface $output The output to use. |
||
107 | * |
||
108 | * @return void |
||
109 | * |
||
110 | * @throws \RuntimeException On exceptions or when the command has an non zero exit code. |
||
111 | */ |
||
112 | protected function executeCommand(Command $command, InputInterface $input, OutputInterface $output) |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | public function doPerform() |
||
136 | } |
||
137 |
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.