[DebugBundle][VarDumper] Fix server dumper placeholder command

This commit is contained in:
Maxime Steinhausser 2018-04-16 22:16:16 +02:00
parent ccb0e84799
commit 60af39b161

View File

@ -11,6 +11,7 @@
namespace Symfony\Bundle\DebugBundle\Command; namespace Symfony\Bundle\DebugBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Console\Style\SymfonyStyle;
@ -24,15 +25,22 @@ use Symfony\Component\VarDumper\Server\DumpServer;
* *
* @internal * @internal
*/ */
class ServerDumpPlaceholderCommand extends ServerDumpCommand class ServerDumpPlaceholderCommand extends Command
{ {
private $replacedCommand;
public function __construct(DumpServer $server = null, array $descriptors = array()) public function __construct(DumpServer $server = null, array $descriptors = array())
{ {
parent::__construct(new class() extends DumpServer { $this->replacedCommand = new ServerDumpCommand((new \ReflectionClass(DumpServer::class))->newInstanceWithoutConstructor(), $descriptors);
public function __construct()
{ parent::__construct();
} }
}, $descriptors);
protected function configure()
{
$this->setDefinition($this->replacedCommand->getDefinition());
$this->setHelp($this->replacedCommand->getHelp());
$this->setDescription($this->replacedCommand->getDescription());
} }
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)