change commands definition to attribute

This commit is contained in:
sunxyw
2022-12-17 21:53:08 +08:00
parent c6f877700e
commit 3806983bc2
11 changed files with 36 additions and 73 deletions

View File

@@ -4,21 +4,16 @@ declare(strict_types=1);
namespace ZM\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand(name: 'check:config', description: '检查配置文件是否和框架当前版本有更新')]
class CheckConfigCommand extends Command
{
protected static $defaultName = 'check:config';
private $need_update = false;
protected function configure()
{
$this->setDescription('检查配置文件是否和框架当前版本有更新');
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
if (LOAD_MODE !== 1) {