Skip to content

Commit

Permalink
Do not use integer keys in forms - ChangePaymentMethodType
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Jan 21, 2021
1 parent ac2d41a commit c03b3f6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
$form = $event->getForm();

foreach ($payments as $key => $payment) {
if (!in_array($payment->getState(), [PaymentInterface::STATE_NEW, PaymentInterface::STATE_CART])) {
$form->remove($key);
if (!in_array($payment->getState(), [PaymentInterface::STATE_NEW, PaymentInterface::STATE_CART], true)) {
$form->remove((string) $key);
}
}
});
Expand Down

0 comments on commit c03b3f6

Please sign in to comment.