-
-
Save adamwojs/1806a29d42e7615e5cd55cf56a00e1b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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