Skip to content

Instantly share code, notes, and snippets.

@adamwojs

adamwojs/ReproducerCommand.php Secret

Created Aug 19, 2019
Embed
What would you like to do?
<?php
// src/AppBundle/Command/ReproducerCommand.php
declare(strict_types=1);
namespace AppBundle\Command;
use EzSystems\EzPlatformPageFieldType\FieldType\LandingPage\Type;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
final class ReproducerCommand extends Command
{
/** @var \EzSystems\EzPlatformPageFieldType\FieldType\LandingPage\Type */
private $fieldType;
public function __construct(Type $fieldType)
{
parent::__construct('bug-report');
$this->fieldType = $fieldType;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$value = $this->fieldType->getEmptyValue();
// Number of page zones !== number of zones in layout.
$value->getPage()->setZones([]);
$this->fieldType->acceptValue($value);
}
}
# /app/config/sevices.yml
services:
_defaults:
autowire: true
autoconfigure: true
public: false
AppBundle\Command\ReproducerCommand: ~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.