1 | <?php |
||
54 | class YapealSetup extends Command implements YEMAwareInterface |
||
55 | { |
||
56 | use CommonToolsTrait, ConfigFileTrait, EveApiEventEmitterTrait, VerbosityToStrategyTrait; |
||
57 | /** |
||
58 | * @param string $name |
||
59 | * @param ContainerInterface $dic |
||
60 | * |
||
61 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
||
62 | * @throws \Symfony\Component\Console\Exception\LogicException |
||
63 | */ |
||
64 | public function __construct(string $name, ContainerInterface $dic) |
||
71 | /** |
||
72 | * Configures the current command. |
||
73 | */ |
||
74 | public function configure() |
||
91 | /** @noinspection PhpMissingParentCallCommonInspection */ |
||
92 | /** |
||
93 | * Executes the current command. |
||
94 | * |
||
95 | * This method is not abstract because you can use this class |
||
96 | * as a concrete class. In this case, instead of defining the |
||
97 | * execute() method, you set the code to execute by passing |
||
98 | * a Closure to the setCode() method. |
||
99 | * |
||
100 | * @param InputInterface $input An InputInterface instance |
||
101 | * @param OutputInterface $output An OutputInterface instance |
||
102 | * |
||
103 | * @return int 0 if everything went fine, or an error code |
||
104 | * @throws \DomainException |
||
105 | * @throws \InvalidArgumentException |
||
106 | * @throws \LogicException When this abstract method is not implemented |
||
107 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
||
108 | * @throws \Symfony\Component\Console\Exception\LogicException |
||
109 | * @throws \Symfony\Component\Console\Exception\RuntimeException |
||
110 | * @throws \Yapeal\Exception\YapealException |
||
111 | * |
||
112 | * @see setCode() |
||
113 | */ |
||
114 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
135 | /** @noinspection PhpMissingParentCallCommonInspection */ |
||
136 | /** |
||
137 | * @param string $option |
||
138 | * @param string $text |
||
139 | */ |
||
140 | private function addMenuChoice(string $option, string $text) |
||
144 | /** |
||
145 | * @return string[] |
||
146 | * @throws \LogicException |
||
147 | */ |
||
148 | private function getMenuChoices(): array |
||
156 | /** |
||
157 | * @return bool |
||
158 | * @throws \LogicException |
||
159 | */ |
||
160 | private function hasConfigFile(): bool |
||
173 | /** |
||
174 | * @return bool |
||
175 | * @throws \LogicException |
||
176 | */ |
||
177 | private function hasSchema(): bool |
||
207 | /** |
||
208 | * @param InputInterface $input |
||
209 | * @param OutputInterface $output |
||
210 | * |
||
211 | * @throws \LogicException |
||
212 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
||
213 | * @throws \Symfony\Component\Console\Exception\LogicException |
||
214 | * @throws \Symfony\Component\Console\Exception\RuntimeException |
||
215 | */ |
||
216 | private function mainMenu(InputInterface $input, OutputInterface $output) |
||
250 | /** |
||
251 | * @param InputInterface $input |
||
252 | * @param OutputInterface $output |
||
253 | */ |
||
254 | private function startInteractive(InputInterface $input, OutputInterface $output) |
||
257 | /** |
||
258 | * @param InputInterface $input |
||
259 | * @param OutputInterface $output |
||
260 | * |
||
261 | * @throws \LogicException |
||
262 | */ |
||
263 | private function yamlMenu(InputInterface $input, OutputInterface $output) |
||
271 | /** |
||
272 | * @var bool $configFile |
||
273 | */ |
||
274 | private $configFile; |
||
275 | /** |
||
276 | * @var string[] $menuChoices |
||
277 | */ |
||
278 | private $menuChoices; |
||
279 | /** |
||
280 | * @var bool $schema |
||
281 | */ |
||
282 | private $schema; |
||
283 | /** |
||
284 | * @var array $yamlFile |
||
285 | */ |
||
286 | private $yamlFile; |
||
287 | } |
||
288 | |||
289 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.