jalismrs/symfony.common.command

添加 Symfony 命令抽象类

这个包的官方仓库似乎已丢失,因此包已被冻结。

1.1.2 2021-03-04 10:49 UTC

This package is auto-updated.

Last update: 2024-05-04 18:02:26 UTC


README

添加 Symfony 命令抽象类

测试

phpunitvendor/bin/phpunit

覆盖率报告将在 var/coverage 中可用

用法

CommandAbstract

use Jalismrs\Symfony\Common\CommandAbstract;

class SomeCommand extends CommandAbstract {

}

MetaCommandAbstract

use Jalismrs\Symfony\Common\MetaCommandAbstract;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class SomeCommand extends MetaCommandAbstract {
    protected function execute(
        InputInterface $input,
        OutputInterface $output
    ): int {
        return $this->runCommand(
            'app:command',
            [
                'parameter' => 'value',
            ],
            $input,
            $output,
        );
    }
}