From 41f3f9bc51bae05a7f8fa31ed660a3ebc380cf3d Mon Sep 17 00:00:00 2001 From: huangzhhui Date: Tue, 9 Jun 2020 23:03:25 +0800 Subject: [PATCH] Use ConfigProvider to register the command and remove useless output --- src/devtool/src/ConfigProvider.php | 5 +++++ src/devtool/src/Describe/RoutesCommand.php | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/devtool/src/ConfigProvider.php b/src/devtool/src/ConfigProvider.php index 5576d3728..da6e2362c 100644 --- a/src/devtool/src/ConfigProvider.php +++ b/src/devtool/src/ConfigProvider.php @@ -11,6 +11,8 @@ declare(strict_types=1); */ namespace Hyperf\Devtool; +use Hyperf\Devtool\Describe; + class ConfigProvider { public function __invoke() @@ -23,6 +25,9 @@ class ConfigProvider ], ], ], + 'commands' => [ + Describe\RoutesCommand::class, + ], 'publish' => [ [ 'id' => 'config', diff --git a/src/devtool/src/Describe/RoutesCommand.php b/src/devtool/src/Describe/RoutesCommand.php index 508ceecb3..b7fd841a3 100644 --- a/src/devtool/src/Describe/RoutesCommand.php +++ b/src/devtool/src/Describe/RoutesCommand.php @@ -11,7 +11,6 @@ declare(strict_types=1); */ namespace Hyperf\Devtool\Describe; -use Hyperf\Command\Annotation\Command; use Hyperf\Command\Command as HyperfCommand; use Hyperf\Contract\ConfigInterface; use Hyperf\HttpServer\MiddlewareManager; @@ -25,9 +24,6 @@ use Symfony\Component\Console\Helper\TableSeparator; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -/** - * @Command - */ class RoutesCommand extends HyperfCommand { /** @@ -58,8 +54,6 @@ class RoutesCommand extends HyperfCommand $this->analyzeRouter($server, $router, $path), $this->output ); - - $this->output->success('success.'); } protected function configure()