@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public function getFilters(): array |
| 33 | 33 | { |
| 34 | 34 | return [ |
| 35 | - new \Twig_Filter('gweb_calculate_deposit', [$this->helper, 'getPrice']), |
|
| 35 | + new \Twig_Filter('gweb_calculate_deposit', [$this->helper, 'getPrice']), |
|
| 36 | 36 | ]; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | continue; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $this->addTaxAdjustment($unit, (int)$taxAmount, $taxRate->getLabel(), $taxRate->isIncludedInPrice()); |
|
| 77 | + $this->addTaxAdjustment($unit, (int) $taxAmount, $taxRate->getLabel(), $taxRate->isIncludedInPrice()); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -28,11 +28,11 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $menu = $event->getMenu(); |
| 30 | 30 | $menu->addChild('deposit', ['position' => 1]) |
| 31 | - ->setAttribute( |
|
| 31 | + ->setAttribute( |
|
| 32 | 32 | 'template', |
| 33 | 33 | '@GwebSyliusDepositPlugin/Resources/views/Admin/ProductVariant/Tab/_deposit.html.twig' |
| 34 | - ) |
|
| 35 | - ->setLabel($this->translator->trans('gweb_deposit.admin.product_variant.menu')) |
|
| 36 | - ->setLabelAttribute('icon', 'dollar'); |
|
| 34 | + ) |
|
| 35 | + ->setLabel($this->translator->trans('gweb_deposit.admin.product_variant.menu')) |
|
| 36 | + ->setLabelAttribute('icon', 'dollar'); |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 28 | 28 | { |
| 29 | 29 | $builder->add('depositTaxCategory', TaxCategoryChoiceType::class, [ |
| 30 | - 'required' => false, |
|
| 31 | - 'placeholder' => '---', |
|
| 32 | - 'label' => 'gweb_deposit.admin.product_variant.tax_category', |
|
| 30 | + 'required' => false, |
|
| 31 | + 'placeholder' => '---', |
|
| 32 | + 'label' => 'gweb_deposit.admin.product_variant.tax_category', |
|
| 33 | 33 | ]); |
| 34 | 34 | |
| 35 | 35 | $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event): void { |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | 'channelDeposits', |
| 40 | 40 | ChannelCollectionType::class, |
| 41 | 41 | [ |
| 42 | - 'entry_type' => ChannelDepositType::class, |
|
| 43 | - 'entry_options' => function (ChannelInterface $channel) use ($productVariant) { |
|
| 44 | - return [ |
|
| 42 | + 'entry_type' => ChannelDepositType::class, |
|
| 43 | + 'entry_options' => function (ChannelInterface $channel) use ($productVariant) { |
|
| 44 | + return [ |
|
| 45 | 45 | 'channel' => $channel, |
| 46 | 46 | 'product_variant' => $productVariant, |
| 47 | 47 | 'required' => false, |
| 48 | - ]; |
|
| 49 | - }, |
|
| 50 | - 'label' => 'gweb_deposit.admin.product_variant.price', |
|
| 48 | + ]; |
|
| 49 | + }, |
|
| 50 | + 'label' => 'gweb_deposit.admin.product_variant.price', |
|
| 51 | 51 | ] |
| 52 | 52 | ); |
| 53 | - } |
|
| 53 | + } |
|
| 54 | 54 | ); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | 'label' => 'gweb_deposit.admin.product_variant.tax_category', |
| 33 | 33 | ]); |
| 34 | 34 | |
| 35 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event): void { |
|
| 35 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event): void { |
|
| 36 | 36 | $productVariant = $event->getData(); |
| 37 | 37 | |
| 38 | 38 | $event->getForm()->add( |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | ChannelCollectionType::class, |
| 41 | 41 | [ |
| 42 | 42 | 'entry_type' => ChannelDepositType::class, |
| 43 | - 'entry_options' => function (ChannelInterface $channel) use ($productVariant) { |
|
| 43 | + 'entry_options' => function(ChannelInterface $channel) use ($productVariant) { |
|
| 44 | 44 | return [ |
| 45 | 45 | 'channel' => $channel, |
| 46 | 46 | 'product_variant' => $productVariant, |
@@ -27,29 +27,29 @@ discard block |
||
| 27 | 27 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 28 | 28 | { |
| 29 | 29 | $builder->add( |
| 30 | - 'price', |
|
| 31 | - MoneyType::class, |
|
| 32 | - [ |
|
| 30 | + 'price', |
|
| 31 | + MoneyType::class, |
|
| 32 | + [ |
|
| 33 | 33 | 'label' => 'gweb_deposit.admin.product_variant.price', |
| 34 | 34 | 'required' => false, |
| 35 | 35 | 'currency' => $options['channel']->getBaseCurrency()->getCode(), |
| 36 | - ] |
|
| 36 | + ] |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | $builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) use ($options): void { |
| 40 | - $channelDeposit = $event->getData(); |
|
| 40 | + $channelDeposit = $event->getData(); |
|
| 41 | 41 | |
| 42 | - if (!$channelDeposit instanceof $this->dataClass) { |
|
| 43 | - $event->setData(null); |
|
| 42 | + if (!$channelDeposit instanceof $this->dataClass) { |
|
| 43 | + $event->setData(null); |
|
| 44 | 44 | |
| 45 | - return; |
|
| 46 | - } |
|
| 45 | + return; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - $channelDeposit->setChannelCode($options['channel']->getCode()); |
|
| 49 | - $channelDeposit->setProductVariant($options['product_variant']); |
|
| 48 | + $channelDeposit->setChannelCode($options['channel']->getCode()); |
|
| 49 | + $channelDeposit->setProductVariant($options['product_variant']); |
|
| 50 | 50 | |
| 51 | - $event->setData($channelDeposit); |
|
| 52 | - } |
|
| 51 | + $event->setData($channelDeposit); |
|
| 52 | + } |
|
| 53 | 53 | ); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -61,17 +61,17 @@ discard block |
||
| 61 | 61 | parent::configureOptions($resolver); |
| 62 | 62 | |
| 63 | 63 | $resolver |
| 64 | - ->setRequired('channel') |
|
| 65 | - ->setAllowedTypes('channel', [ChannelInterface::class]) |
|
| 66 | - ->setDefined('product_variant') |
|
| 67 | - ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
|
| 68 | - ->setDefaults( |
|
| 64 | + ->setRequired('channel') |
|
| 65 | + ->setAllowedTypes('channel', [ChannelInterface::class]) |
|
| 66 | + ->setDefined('product_variant') |
|
| 67 | + ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
|
| 68 | + ->setDefaults( |
|
| 69 | 69 | [ |
| 70 | - 'label' => function (Options $options): string { |
|
| 71 | - return $options['channel']->getName(); |
|
| 72 | - }, |
|
| 70 | + 'label' => function (Options $options): string { |
|
| 71 | + return $options['channel']->getName(); |
|
| 72 | + }, |
|
| 73 | 73 | ] |
| 74 | - ); |
|
| 74 | + ); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | ] |
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | - $builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) use ($options): void { |
|
| 39 | + $builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) use ($options): void { |
|
| 40 | 40 | $channelDeposit = $event->getData(); |
| 41 | 41 | |
| 42 | 42 | if (!$channelDeposit instanceof $this->dataClass) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) |
| 68 | 68 | ->setDefaults( |
| 69 | 69 | [ |
| 70 | - 'label' => function (Options $options): string { |
|
| 70 | + 'label' => function(Options $options): string { |
|
| 71 | 71 | return $options['channel']->getName(); |
| 72 | 72 | }, |
| 73 | 73 | ] |