diff --git a/src/CliApp.php b/src/CliApp.php index 45a5fee..04546cd 100644 --- a/src/CliApp.php +++ b/src/CliApp.php @@ -302,7 +302,7 @@ protected function initCommandFlags(string $command, $handler): FlagsParser * * @return mixed */ - public function runHandler($handler, FlagsParser $cFlags): mixed + public function runHandler($handler, FlagsParser $cFlags) { // function name if (is_string($handler) && function_exists($handler)) { diff --git a/test/CliAppTest.php b/test/CliAppTest.php index d4bb370..b526a39 100644 --- a/test/CliAppTest.php +++ b/test/CliAppTest.php @@ -4,7 +4,6 @@ use Toolkit\PFlag\CliApp; use Toolkit\Stdlib\Obj\DataObject; -use const PHP_VERSION_ID; /** * class CliAppTest @@ -17,18 +16,16 @@ private function initApp(CliApp $app): DataObject { $buf = DataObject::new(); - if (PHP_VERSION_ID > 70400) { - $app->add('test1', fn() => $buf->set('key', 'in test1')); - } else { - $app->add('test1', function() use($buf) { - $buf->set('key', 'in test2'); - }); - } + // php 7.4+ + // $app->add('test1', fn() => $buf->set('key', 'in test1')); + $app->add('test1', function () use ($buf) { + $buf->set('key', 'in test1'); + }); $app->addCommands([ 'test2' => [ - 'desc' => 'desc for test2 command', - 'handler' => function() use($buf) { + 'desc' => 'desc for test2 command', + 'handler' => function () use ($buf) { $buf->set('key', 'in test2'); }, 'options' => [