<?php
declare(strict_types=1);
namespace App\Form\EventListener\Admin\PaymentMethod;
use App\Form\Admin\PaymentMethod\GatewayConfigType;
use App\Form\FormHelper;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class AddGateWayConfigFieldSubscriber extends FormHelper implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [FormEvents::PRE_SET_DATA => 'preSetData'];
}
public function preSetData(FormEvent $event): void
{
$event->getForm()->add('gatewayConfig', GatewayConfigType::class, [
'label' => false,
]);
}
}