Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicated options from the email transport select box #8304

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 3 additions & 10 deletions app/bundles/EmailBundle/Form/Type/ConfigType.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,12 @@ class ConfigType extends AbstractType
*/
private $transportType;

/**
* @param TranslatorInterface $translator
* @param TransportType $transportType
*/
public function __construct(TranslatorInterface $translator, TransportType $transportType)
{
$this->translator = $translator;
$this->transportType = $transportType;
}

/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->addEventSubscriber(
Expand Down Expand Up @@ -807,9 +799,10 @@ public function getBlockPrefix()
*/
private function getTransportChoices()
{
$choices = $this->transportType->getTransportTypes();
$choices = [];
$transports = $this->transportType->getTransportTypes();

foreach ($choices as $value => $label) {
foreach ($transports as $value => $label) {
$choices[$this->translator->trans($label)] = $value;
}

Expand Down