Skip to content

Instantly share code, notes, and snippets.

@adamwojs
Created August 19, 2019 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamwojs/1806a29d42e7615e5cd55cf56a00e1b8 to your computer and use it in GitHub Desktop.
Save adamwojs/1806a29d42e7615e5cd55cf56a00e1b8 to your computer and use it in GitHub Desktop.
<?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