Skip to content

Commit

Permalink
OP-550 - Fix code standards
Browse files Browse the repository at this point in the history
  • Loading branch information
JanPalen committed Jan 3, 2025
1 parent a1e5737 commit cbf730f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Component/Product/AddToCartFormComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public function __construct(
ProductRepositoryInterface $productRepository,
ProductVariantRepositoryInterface $productVariantRepository,
private readonly AddProductBundleToCartDtoFactory $addProductBundleToCartDtoFactory,

) {
$this->initializeProduct($productRepository);
$this->initializeProductVariant($productVariantRepository);

parent::__construct($this->formFactory,
parent::__construct(
$this->formFactory,
$this->manager,
$this->router,
$this->requestStack,
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/CartItemAddListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
final class CartItemAddListener
{
public function __construct(
private readonly OrderModifierInterface $orderModifier
private readonly OrderModifierInterface $orderModifier,
) {
}

Expand Down
1 change: 0 additions & 1 deletion src/Form/Type/ProductBundleItemType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ final class ProductBundleItemType extends AbstractResourceType
{
public function buildForm(FormBuilderInterface $builder, array $options = []): void
{

$builder
->add('quantity', IntegerType::class, [
'label' => false,
Expand Down
6 changes: 3 additions & 3 deletions src/Handler/Api/AddProductBundleToCartHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class AddProductBundleToCartHandler
public function __construct(
private OrderRepositoryInterface $orderRepository,
private ProductRepositoryInterface $productRepository,
private CartProcessorInterface $cartProcessor
private CartProcessorInterface $cartProcessor,
) {
}

Expand All @@ -36,11 +36,11 @@ public function __invoke(AddProductBundleToCartDto $addProductBundleToCartComman
/** @var OrderInterface|null $cart */
$cart = $this->orderRepository->findCartByTokenValue($addProductBundleToCartCommand->getOrderTokenValue());

if ($cart === null) {
if (null === $cart) {
throw new \InvalidArgumentException('Cart with given token has not been found.');
}

/** @var null|ProductInterface $product */
/** @var ProductInterface|null $product */
$product = $this->productRepository->findOneByCode($addProductBundleToCartCommand->getProductCode());
Assert::notNull($product);
Assert::true($product->isBundle());
Expand Down
3 changes: 1 addition & 2 deletions src/Twig/Extension/ProductBundleOrderItemExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace BitBag\SyliusProductBundlePlugin\Twig\Extension;

use BitBag\SyliusProductBundlePlugin\Entity\ProductInterface;
use http\Exception\RuntimeException;
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
Expand All @@ -30,7 +29,7 @@ public function getFunctions(): array
new TwigFunction(
'bitbag_render_product_bundle_order_items',
[$this, 'renderProductBundleOrderItems'],
['is_safe' => ['html']]
['is_safe' => ['html']],
),
];
}
Expand Down

0 comments on commit cbf730f

Please sign in to comment.