@@ -28,30 +28,30 @@ discard block |
||
| 28 | 28 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 29 | 29 | { |
| 30 | 30 | $builder->add( |
| 31 | - 'price', |
|
| 32 | - MoneyType::class, |
|
| 33 | - [ |
|
| 31 | + 'price', |
|
| 32 | + MoneyType::class, |
|
| 33 | + [ |
|
| 34 | 34 | 'label' => 'gweb_deposit.admin.product_variant.price', |
| 35 | 35 | 'required' => false, |
| 36 | 36 | 'currency' => $options['channel']->getBaseCurrency()->getCode(), |
| 37 | - ] |
|
| 37 | + ] |
|
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | $builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) use ($options): void { |
| 41 | - /** @var ChannelDepositInterface $channelDeposit */ |
|
| 42 | - $channelDeposit = $event->getData(); |
|
| 41 | + /** @var ChannelDepositInterface $channelDeposit */ |
|
| 42 | + $channelDeposit = $event->getData(); |
|
| 43 | 43 | |
| 44 | - if (!$channelDeposit instanceof $this->dataClass) { |
|
| 45 | - $event->setData(null); |
|
| 44 | + if (!$channelDeposit instanceof $this->dataClass) { |
|
| 45 | + $event->setData(null); |
|
| 46 | 46 | |
| 47 | - return; |
|
| 48 | - } |
|
| 47 | + return; |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - $channelDeposit->setChannelCode($options['channel']->getCode()); |
|
| 51 | - $channelDeposit->setProductVariant($options['product_variant']); |
|
| 50 | + $channelDeposit->setChannelCode($options['channel']->getCode()); |
|
| 51 | + $channelDeposit->setProductVariant($options['product_variant']); |
|
| 52 | 52 | |
| 53 | - $event->setData($channelDeposit); |
|
| 54 | - } |
|
| 53 | + $event->setData($channelDeposit); |
|
| 54 | + } |
|
| 55 | 55 | ); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -63,17 +63,17 @@ discard block |
||
| 63 | 63 | parent::configureOptions($resolver); |
| 64 | 64 | |
| 65 | 65 | $resolver |
| 66 | - ->setRequired('channel') |
|
| 67 | - ->setAllowedTypes('channel', [ChannelInterface::class]) |
|
| 68 | - ->setDefined('product_variant') |
|
| 69 | - ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
|
| 70 | - ->setDefaults( |
|
| 66 | + ->setRequired('channel') |
|
| 67 | + ->setAllowedTypes('channel', [ChannelInterface::class]) |
|
| 68 | + ->setDefined('product_variant') |
|
| 69 | + ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
|
| 70 | + ->setDefaults( |
|
| 71 | 71 | [ |
| 72 | - 'label' => function (Options $options): string { |
|
| 73 | - return $options['channel']->getName(); |
|
| 74 | - }, |
|
| 72 | + 'label' => function (Options $options): string { |
|
| 73 | + return $options['channel']->getName(); |
|
| 74 | + }, |
|
| 75 | 75 | ] |
| 76 | - ); |
|
| 76 | + ); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ] |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | - $builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) use ($options): void { |
|
| 40 | + $builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) use ($options): void { |
|
| 41 | 41 | /** @var ChannelDepositInterface $channelDeposit */ |
| 42 | 42 | $channelDeposit = $event->getData(); |
| 43 | 43 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
| 70 | 70 | ->setDefaults( |
| 71 | 71 | [ |
| 72 | - 'label' => function (Options $options): string { |
|
| 72 | + 'label' => function(Options $options): string { |
|
| 73 | 73 | return $options['channel']->getName(); |
| 74 | 74 | }, |
| 75 | 75 | ] |