Merge pull request #1394 from huangzhhui/master

Change the command the desc
This commit is contained in:
李铭昕 2020-03-05 14:47:57 +08:00 committed by GitHub
commit bf0a707101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,6 @@ use Symfony\Component\Console\Style\SymfonyStyle;
*/ */
class InfoRouteCommand extends SymfonyCommand class InfoRouteCommand extends SymfonyCommand
{ {
protected $routes = [BASE_PATH . '/config/routes.php'];
/** /**
* @var ContainerInterface * @var ContainerInterface
@ -44,15 +43,15 @@ class InfoRouteCommand extends SymfonyCommand
public function __construct(ContainerInterface $container, ConfigInterface $config) public function __construct(ContainerInterface $container, ConfigInterface $config)
{ {
parent::__construct('info:routes'); parent::__construct('describe:routes');
$this->container = $container; $this->container = $container;
$this->config = $config; $this->config = $config;
} }
protected function configure() protected function configure()
{ {
$this->setDescription('Get routes [{path}] to get the route info.') $this->setDescription('Describe the routes information.')
->addOption('path', 'p', InputOption::VALUE_OPTIONAL, 'Detail of single route'); ->addOption('path', 'p', InputOption::VALUE_OPTIONAL, 'Get the detail of the specified route information by path');
} }
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
@ -99,7 +98,7 @@ class InfoRouteCommand extends SymfonyCommand
$io->success('success.'); $io->success('success.');
} }
private function show($data, $output) private function show(array $data, OutputInterface $output)
{ {
$rows = []; $rows = [];
foreach ($data as $route) { foreach ($data as $route) {