ServerDumpCommand example


#[AsCommand(name: 'server:dump', description: 'Start a dump server that collects and displays dumps in a single place')] class ServerDumpPlaceholderCommand extends Command
{
    private ServerDumpCommand $replacedCommand;

    public function __construct(DumpServer $server = null, array $descriptors = [])
    {
        $this->replacedCommand = new ServerDumpCommand((new \ReflectionClass(DumpServer::class))->newInstanceWithoutConstructor()$descriptors);

        parent::__construct();
    }

    protected function configure(): void
    {
        $this->setDefinition($this->replacedCommand->getDefinition());
        $this->setHelp($this->replacedCommand->getHelp());
        $this->setDescription($this->replacedCommand->getDescription());
    }

    
public static function provideCompletionSuggestions()
    {
        yield 'option --format' => [
            ['--format', ''],
            ['cli', 'html'],
        ];
    }

    private function createCommand(): ServerDumpCommand
    {
        return new ServerDumpCommand($this->createMock(DumpServer::class));
    }
}
Home | Imprint | This part of the site doesn't use cookies.