2020use Fidry \Console \Command \CommandAwareness ;
2121use Fidry \Console \Command \Configuration as CommandConfiguration ;
2222use Fidry \Console \ExitCode ;
23- use Fidry \Console \Input \ IO ;
23+ use Fidry \Console \IO ;
2424use Humbug \PhpScoper \Configuration \Configuration ;
2525use Humbug \PhpScoper \Configuration \ConfigurationFactory ;
2626use Humbug \PhpScoper \Console \ConfigLoader ;
@@ -165,8 +165,8 @@ public function execute(IO $io): int
165165
166166 private static function getStopOnFailure (IO $ io ): bool
167167 {
168- $ stopOnFailure = $ io ->getOption (self ::STOP_ON_FAILURE_OPT )->asBoolean ();
169- $ continueOnFailure = $ io ->getOption (self ::CONTINUE_ON_FAILURE_OPT )->asBoolean ();
168+ $ stopOnFailure = $ io ->getTypedOption (self ::STOP_ON_FAILURE_OPT )->asBoolean ();
169+ $ continueOnFailure = $ io ->getTypedOption (self ::CONTINUE_ON_FAILURE_OPT )->asBoolean ();
170170
171171 if ($ stopOnFailure ) {
172172 $ io ->info (
@@ -196,7 +196,7 @@ private static function getStopOnFailure(IO $io): bool
196196 */
197197 private function getOutputDir (IO $ io , Configuration $ configuration ): string
198198 {
199- $ commandOutputDir = $ io ->getOption (self ::OUTPUT_DIR_OPT )->asString ();
199+ $ commandOutputDir = $ io ->getTypedOption (self ::OUTPUT_DIR_OPT )->asString ();
200200
201201 if ('' !== $ commandOutputDir ) {
202202 return $ commandOutputDir ;
@@ -236,7 +236,7 @@ private static function checkPathIsWriteable(string $path): void
236236
237237 private static function canDeleteOutputDir (IO $ io , string $ outputDir ): bool
238238 {
239- if ($ io ->getOption (self ::FORCE_OPT )->asBoolean ()) {
239+ if ($ io ->getTypedOption (self ::FORCE_OPT )->asBoolean ()) {
240240 return true ;
241241 }
242242
@@ -263,8 +263,8 @@ private function retrieveConfig(IO $io, array $paths, string $cwd): Configuratio
263263
264264 return $ configLoader ->loadConfig (
265265 $ io ,
266- $ io ->getOption (self ::PREFIX_OPT )->asString (),
267- $ io ->getOption (self ::NO_CONFIG_OPT )->asBoolean (),
266+ $ io ->getTypedOption (self ::PREFIX_OPT )->asString (),
267+ $ io ->getTypedOption (self ::NO_CONFIG_OPT )->asBoolean (),
268268 $ this ->getConfigFilePath ($ io , $ cwd ),
269269 ConfigurationFactory::DEFAULT_FILE_NAME ,
270270 $ this ->init ,
@@ -278,7 +278,7 @@ private function retrieveConfig(IO $io, array $paths, string $cwd): Configuratio
278278 */
279279 private function getConfigFilePath (IO $ io , string $ cwd ): ?string
280280 {
281- $ configFilePath = (string ) $ io ->getOption (self ::CONFIG_FILE_OPT )->asNullableString ();
281+ $ configFilePath = (string ) $ io ->getTypedOption (self ::CONFIG_FILE_OPT )->asNullableString ();
282282
283283 return '' === $ configFilePath ? null : $ this ->canonicalizePath ($ configFilePath , $ cwd );
284284 }
@@ -290,7 +290,7 @@ private function getPathArguments(IO $io, string $cwd): array
290290 {
291291 return array_map (
292292 fn (string $ path ) => $ this ->canonicalizePath ($ path , $ cwd ),
293- $ io ->getArgument (self ::PATH_ARG )->asNonEmptyStringList (),
293+ $ io ->getTypedArgument (self ::PATH_ARG )->asNonEmptyStringList (),
294294 );
295295 }
296296
0 commit comments