1 | <?php |
||
37 | abstract class AbstractCommand extends Command |
||
38 | { |
||
39 | /** |
||
40 | * Input object |
||
41 | * |
||
42 | * @var \Symfony\Component\Console\Input\InputInterface |
||
43 | */ |
||
44 | protected $input; |
||
45 | |||
46 | /** |
||
47 | * Output object |
||
48 | * |
||
49 | * @var \Symfony\Component\Console\Output\OutputInterface |
||
50 | */ |
||
51 | protected $output; |
||
52 | |||
53 | /** |
||
54 | * Cached request object with desired secure flag |
||
55 | * |
||
56 | * @var \MageScan\Request |
||
57 | */ |
||
58 | protected $request; |
||
59 | |||
60 | /** |
||
61 | * Configure command |
||
62 | * |
||
63 | * @return void |
||
64 | */ |
||
65 | protected function configure() |
||
87 | |||
88 | /** |
||
89 | * Initialize command |
||
90 | * |
||
91 | * @param InputInterface $input |
||
92 | * @param OutputInterface $output |
||
93 | * |
||
94 | * @return void |
||
95 | */ |
||
96 | protected function initialize(InputInterface $input, OutputInterface $output) |
||
112 | |||
113 | /** |
||
114 | * Output information in the correct format |
||
115 | * |
||
116 | * @param string $title |
||
117 | * @param array|string $messages |
||
118 | * |
||
119 | * @return void |
||
120 | */ |
||
121 | protected function out($title, $messages = []) |
||
132 | |||
133 | /** |
||
134 | * Output in default format |
||
135 | * |
||
136 | * @param string $title |
||
137 | * @param array|string $messages |
||
138 | * |
||
139 | * @return void |
||
140 | */ |
||
141 | protected function outputFormatDefault($title, $messages) |
||
161 | |||
162 | /** |
||
163 | * Output in json format |
||
164 | * |
||
165 | * @param string $title |
||
166 | * @param array|string $messages |
||
167 | * |
||
168 | * @return void |
||
169 | */ |
||
170 | protected function outputFormatJson($title, $messages) |
||
201 | |||
202 | /** |
||
203 | * Write a header block |
||
204 | * |
||
205 | * @param string $text |
||
206 | * @param string $style |
||
207 | * |
||
208 | * @return void |
||
209 | */ |
||
210 | protected function writeHeader($text, $style = 'bg=blue;fg=white') |
||
219 | } |
||
220 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.