<?php
declare(strict_types=1);
namespace App\Form\EventListener\Admin\MailTransport;
use App\Form\FormHelper;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class AddDnsFieldSubscriber extends FormHelper implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [FormEvents::PRE_SET_DATA => 'preSetData'];
}
public function preSetData(FormEvent $event): void
{
$event->getForm()->add('dsn', TextType::class, $this->getTextParameters('app.admin.pages.mail_transports.form.dsn', self::PLACEHOLDER_SAME_AS_LABEL, true));
}
}