diff --git a/src/CLI.php b/src/CLI.php index 100d86d..f16688f 100644 --- a/src/CLI.php +++ b/src/CLI.php @@ -73,7 +73,8 @@ public function __construct(Factory $factory) { * * @return int exit code */ - public function run(array $env) { + public function run(array $env): int + { try { @@ -85,12 +86,12 @@ public function run(array $env) { if ($input->getOption('help')->value === TRUE) { $this->showVersion(); $this->showUsage(); - exit(CLI::RC_OK); + return CLI::RC_OK; } if ($input->getOption('version')->value === TRUE ) { $this->showVersion(); - exit(CLI::RC_OK); + return CLI::RC_OK; } $config = $this->configure($env, $input); @@ -98,8 +99,8 @@ public function run(array $env) { if (!$config->isQuietMode()) { $this->showVersion(); } - $rc = $this->factory->getApplication()->run(); - return $rc; + + return $this->factory->getApplication()->run(); } catch (CLIEnvironmentException $e) { $this->showVersion();