1919use Symfony \Component \Console \Exception \RuntimeException ;
2020use Symfony \Component \Console \Input \ArrayInput ;
2121use Symfony \Component \Console \Input \InputInterface ;
22- use Symfony \Component \Console \Output \OutputInterface ;
22+ use Symfony \Component \Console \Output \OutputInterface as SymfonyOutputInterface ;
2323use Ymir \Cli \ApiClient ;
2424use Ymir \Cli \CliConfiguration ;
2525use Ymir \Cli \Command \Network \CreateNetworkCommand ;
2626use Ymir \Cli \Command \Provider \ConnectProviderCommand ;
27- use Ymir \Cli \Console \ConsoleOutput ;
2827use Ymir \Cli \Console \HiddenInputOption ;
2928use Ymir \Cli \Console \InputDefinition ;
29+ use Ymir \Cli \Console \Output ;
30+ use Ymir \Cli \Console \OutputInterface ;
3031use Ymir \Cli \Exception \ApiClientException ;
3132use Ymir \Cli \Exception \CommandCancelledException ;
3233use Ymir \Cli \ProjectConfiguration \ProjectConfiguration ;
@@ -82,7 +83,7 @@ public function addHiddenOption($name, $shortcut = null, $mode = null, $default
8283 /**
8384 * Determine the cloud provider to use.
8485 */
85- protected function determineCloudProvider (string $ question , InputInterface $ input , ConsoleOutput $ output ): int
86+ protected function determineCloudProvider (string $ question , InputInterface $ input , OutputInterface $ output ): int
8687 {
8788 $ providerId = $ this ->getStringOption ($ input , 'provider ' , true );
8889 $ providers = $ this ->apiClient ->getProviders ($ this ->cliConfiguration ->getActiveTeamId ());
@@ -107,7 +108,7 @@ protected function determineCloudProvider(string $question, InputInterface $inpu
107108 /**
108109 * Determine the network to use.
109110 */
110- protected function determineNetwork (string $ question , InputInterface $ input , ConsoleOutput $ output ): int
111+ protected function determineNetwork (string $ question , InputInterface $ input , OutputInterface $ output ): int
111112 {
112113 $ networkIdOrName = null ;
113114
@@ -137,7 +138,7 @@ protected function determineNetwork(string $question, InputInterface $input, Con
137138 /**
138139 * Determine the network to use or create one otherwise.
139140 */
140- protected function determineOrCreateNetwork (string $ question , InputInterface $ input , ConsoleOutput $ output )
141+ protected function determineOrCreateNetwork (string $ question , InputInterface $ input , OutputInterface $ output )
141142 {
142143 $ networks = $ this ->apiClient ->getTeamNetworks ($ this ->cliConfiguration ->getActiveTeamId ())->whereNotIn ('status ' , ['deleting ' , 'failed ' ]);
143144
@@ -159,7 +160,7 @@ protected function determineOrCreateNetwork(string $question, InputInterface $in
159160 /**
160161 * Determine the project to use.
161162 */
162- protected function determineProject (string $ question , InputInterface $ input , ConsoleOutput $ output ): int
163+ protected function determineProject (string $ question , InputInterface $ input , OutputInterface $ output ): int
163164 {
164165 $ projects = $ this ->apiClient ->getTeamProjects ($ this ->cliConfiguration ->getActiveTeamId ());
165166
@@ -187,7 +188,7 @@ protected function determineProject(string $question, InputInterface $input, Con
187188 /**
188189 * Determine the cloud provider region to use.
189190 */
190- protected function determineRegion (string $ question , int $ providerId , InputInterface $ input , ConsoleOutput $ output ): string
191+ protected function determineRegion (string $ question , int $ providerId , InputInterface $ input , OutputInterface $ output ): string
191192 {
192193 $ region = $ this ->getStringOption ($ input , 'region ' , true );
193194 $ regions = $ this ->apiClient ->getRegions ($ providerId );
@@ -206,15 +207,15 @@ protected function determineRegion(string $question, int $providerId, InputInter
206207 /**
207208 * {@inheritdoc}
208209 */
209- protected function execute (InputInterface $ input , OutputInterface $ output )
210+ protected function execute (InputInterface $ input , SymfonyOutputInterface $ output )
210211 {
211212 if (!$ input ->isInteractive () && $ this ->mustBeInteractive ()) {
212213 throw new RuntimeException (sprintf ('Cannot run "%s" command in non-interactive mode ' , $ input ->getFirstArgument ()));
213214 } elseif (LoginCommand::NAME !== $ this ->getName () && !$ this ->apiClient ->isAuthenticated ()) {
214215 throw new RuntimeException (sprintf ('Please authenticate using the "%s" command before using this command ' , LoginCommand::NAME ));
215216 }
216217
217- return $ this ->perform ($ input , new ConsoleOutput ($ input , $ output )) ?? 0 ;
218+ return $ this ->perform ($ input , new Output ($ input , $ output )) ?? 0 ;
218219 }
219220
220221 /**
@@ -334,7 +335,7 @@ protected function getStringOption(InputInterface $input, string $option, bool $
334335 /**
335336 * Invoke another console command.
336337 */
337- protected function invoke (OutputInterface $ output , string $ command , array $ arguments = []): int
338+ protected function invoke (SymfonyOutputInterface $ output , string $ command , array $ arguments = []): int
338339 {
339340 $ application = $ this ->getApplication ();
340341
@@ -356,7 +357,7 @@ protected function mustBeInteractive(): bool
356357 /**
357358 * Retry an API operation.
358359 */
359- protected function retryApi (callable $ callable , string $ message , ConsoleOutput $ output )
360+ protected function retryApi (callable $ callable , string $ message , OutputInterface $ output )
360361 {
361362 while (true ) {
362363 try {
@@ -392,5 +393,5 @@ protected function wait(callable $callable, int $timeout = 60, int $sleep = 1)
392393 /**
393394 * Perform the command.
394395 */
395- abstract protected function perform (InputInterface $ input , ConsoleOutput $ output );
396+ abstract protected function perform (InputInterface $ input , OutputInterface $ output );
396397}
0 commit comments