| @@ -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 | } | 
| @@ -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, | 
| @@ -29,11 +29,11 @@ | ||
| 29 | 29 | $menu = $event->getMenu(); | 
| 30 | 30 | |
| 31 | 31 |          $menu->addChild('deposit', ['position' => 1]) | 
| 32 | - ->setAttribute( | |
| 32 | + ->setAttribute( | |
| 33 | 33 | 'template', | 
| 34 | 34 | '@GwebSyliusProductDepositPlugin/Resources/views/Admin/ProductVariant/Tab/_deposit.html.twig' | 
| 35 | - ) | |
| 36 | -          ->setLabel($this->translator->trans('gweb_deposit.admin.product_variant.menu')) | |
| 37 | -          ->setLabelAttribute('icon', 'dollar'); | |
| 35 | + ) | |
| 36 | +            ->setLabel($this->translator->trans('gweb_deposit.admin.product_variant.menu')) | |
| 37 | +            ->setLabelAttribute('icon', 'dollar'); | |
| 38 | 38 | } | 
| 39 | 39 | } | 
| @@ -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 | ] |