Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Jun 24, 2024
1 parent 53afe17 commit f6a3873
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Form/Extension/OrderTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void

$form
->add('items', OrderItemCollectionType::class, [
'entry_options' => ['currency_code' => $order->getCurrencyCode()]
'entry_options' => ['currency_code' => $order->getCurrencyCode()],
])
;

Expand Down
5 changes: 2 additions & 3 deletions src/Form/Type/OrderItemType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Setono\SyliusOrderEditPlugin\Form\Type;

use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Core\Model\ProductVariant;
use Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface;
Expand All @@ -14,8 +13,6 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class OrderItemType extends AbstractResourceType
Expand Down Expand Up @@ -47,6 +44,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
])
;

/** @var string $currencyCode */
$currencyCode = $options['currency_code'];

$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($currencyCode): void {
Expand Down Expand Up @@ -75,5 +73,6 @@ public function configureOptions(OptionsResolver $resolver): void
parent::configureOptions($resolver);

$resolver->setRequired('currency_code');
$resolver->setAllowedTypes('currency_code', 'string');
}
}

0 comments on commit f6a3873

Please sign in to comment.