Skip to content

Commit

Permalink
[WIP]OP-289: Implement handling unpacked bundles in API
Browse files Browse the repository at this point in the history
  • Loading branch information
hmfilar committed Sep 10, 2024
1 parent 3dff2a8 commit 3296e11
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/Command/AddProductBundleToCartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace BitBag\SyliusProductBundlePlugin\Command;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;

final class AddProductBundleToCartCommand implements OrderIdentityAwareInterface, ProductCodeAwareInterface
Expand All @@ -19,10 +20,11 @@ final class AddProductBundleToCartCommand implements OrderIdentityAwareInterface
private Collection $productBundleItems;

public function __construct(
private int $orderId,
private string $productCode,
private int $quantity = 1,
private readonly int $orderId,
private readonly string $productCode,
private readonly int $quantity = 1,
) {
$this->productBundleItems = new ArrayCollection();
}

public function getOrderId(): int
Expand Down
13 changes: 12 additions & 1 deletion src/DataTransformer/AddProductBundleToCartDtoDataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@
use ApiPlatform\Core\DataTransformer\DataTransformerInterface;
use BitBag\SyliusProductBundlePlugin\Command\AddProductBundleToCartCommand;
use BitBag\SyliusProductBundlePlugin\Dto\Api\AddProductBundleToCartDto;
use BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProviderInterface;
use Sylius\Component\Order\Model\OrderInterface;
use Webmozart\Assert\Assert;

final class AddProductBundleToCartDtoDataTransformer implements DataTransformerInterface
{
public const OBJECT_TO_POPULATE = 'object_to_populate';

public function __construct(
private readonly AddProductBundleItemToCartCommandProviderInterface $addProductBundleItemToCartCommandProvider,
) {
}

/**
* @param AddProductBundleToCartDto|object $object
*/
Expand All @@ -37,8 +43,13 @@ public function transform(

$productCode = $object->getProductCode();
$quantity = $object->getQuantity();
$variantCodes = $object->getVariantCodes();
$addItemToCartCommands = $this->addProductBundleItemToCartCommandProvider->provide($productCode, $variantCodes);

$command = new AddProductBundleToCartCommand($cart->getId(), $productCode, $quantity);
$command->setProductBundleItems($addItemToCartCommands);

return new AddProductBundleToCartCommand($cart->getId(), $productCode, $quantity);
return $command;
}

public function supportsTransformation(
Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface;
use BitBag\SyliusProductBundlePlugin\Form\Type\ProductBundleItemType;
use BitBag\SyliusProductBundlePlugin\Form\Type\ProductBundleType;
use BitBag\SyliusProductBundlePlugin\Repository\ProductBundleItemRepository;
use BitBag\SyliusProductBundlePlugin\Repository\ProductBundleRepository;
use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
Expand Down Expand Up @@ -80,7 +81,7 @@ private function addResourcesSection(ArrayNodeDefinition $node): void
->scalarNode('interface')->defaultValue(ProductBundleItemInterface::class)->cannotBeEmpty()->end()
->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end()
->scalarNode('repository')->cannotBeEmpty()->end()
->scalarNode('repository')->defaultValue(ProductBundleItemRepository::class)->cannotBeEmpty()->end()
->scalarNode('form')->defaultValue(ProductBundleItemType::class)->cannotBeEmpty()->end()
->end()
->end()
Expand Down
11 changes: 11 additions & 0 deletions src/Dto/Api/AddProductBundleToCartDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function __construct(
private string $productCode,
private int $quantity = 1,
private ?string $orderTokenValue = null,
private array $variantCodes = [],
) {
}

Expand All @@ -41,4 +42,14 @@ public function getQuantity(): int
{
return $this->quantity;
}

public function getVariantCodes(): array
{
return $this->variantCodes;
}

public function setVariantCodes(array $variantCodes): void
{
$this->variantCodes = $variantCodes;
}
}
2 changes: 1 addition & 1 deletion src/Factory/AddProductBundleToCartCommandFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

final class AddProductBundleToCartCommandFactory implements AddProductBundleToCartCommandFactoryInterface
{
/** @param Collection<int, AddProductBundleItemToCartCommand> */
/** @param Collection<int, AddProductBundleItemToCartCommand> $productBundleItems */
public function createNew(

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()

Check failure on line 22 in src/Factory/AddProductBundleToCartCommandFactory.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Parameter #4 $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactory::createNew() should be compatible with parameter $productBundleItems (Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Entity\ProductBundleOrderItemInterface>) of method BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleToCartCommandFactoryInterface::createNew()
int $orderId,
string $productCode,
Expand Down
6 changes: 3 additions & 3 deletions src/Handler/AddProductBundleToCartHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
final class AddProductBundleToCartHandler implements MessageHandlerInterface
{
public function __construct(
private OrderRepositoryInterface $orderRepository,
private ProductRepositoryInterface $productRepository,
private CartProcessorInterface $cartProcessor,
private readonly OrderRepositoryInterface $orderRepository,
private readonly ProductRepositoryInterface $productRepository,
private readonly CartProcessorInterface $cartProcessor,
) {
}

Expand Down
44 changes: 44 additions & 0 deletions src/Provider/AddProductBundleItemToCartCommandProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\SyliusProductBundlePlugin\Provider;

use BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand;
use BitBag\SyliusProductBundlePlugin\Factory\AddProductBundleItemToCartCommandFactoryInterface;
use BitBag\SyliusProductBundlePlugin\Repository\ProductBundleItemRepositoryInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;

final class AddProductBundleItemToCartCommandProvider implements AddProductBundleItemToCartCommandProviderInterface
{
public function __construct(
private readonly AddProductBundleItemToCartCommandFactoryInterface $addProductBundleItemToCartCommandFactory,
private readonly ProductBundleItemRepositoryInterface $productBundleItemRepository,
) {
}

/** @return Collection<int, AddProductBundleItemToCartCommand> */
public function provide(string $bundleCode, array $variantCodes): Collection
{
$bundleItems = $this->productBundleItemRepository->findByBundleCode($bundleCode);

$items = '';
foreach ($bundleItems as $bundleItem) {
$items .= $bundleItem->getProductVariant()->getCode() . ', ';

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.

Check failure on line 35 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot call method getCode() on Sylius\Component\Core\Model\ProductVariantInterface|null.
}

$commands = [];
foreach ($bundleItems as $bundleItem) {

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.

Check failure on line 39 in src/Provider/AddProductBundleItemToCartCommandProvider.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Method BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider::provide() should return Doctrine\Common\Collections\Collection<int, BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand> but return statement is missing.
$command = $this->addProductBundleItemToCartCommandFactory->createNew($bundleItem);
//TODO implement overwritting bundle's variants with variants provided in API call
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\SyliusProductBundlePlugin\Provider;

use BitBag\SyliusProductBundlePlugin\Command\AddProductBundleItemToCartCommand;
use Doctrine\Common\Collections\Collection;

interface AddProductBundleItemToCartCommandProviderInterface
{
/** @return Collection<int, AddProductBundleItemToCartCommand> */
public function provide(string $bundleCode, array $variantCodes): Collection;
}
31 changes: 31 additions & 0 deletions src/Repository/ProductBundleItemRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\SyliusProductBundlePlugin\Repository;

use BitBag\SyliusProductBundlePlugin\Entity\ProductBundleItemInterface;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;

class ProductBundleItemRepository extends EntityRepository implements ProductBundleItemRepositoryInterface
{
/** @return ProductBundleItemInterface[] */
public function findByBundleCode(string $bundleCode): array
{
return $this
->createQueryBuilder('pbi')
->leftJoin('pbi.productBundle', 'pb')
->leftJoin('pb.product', 'p')
->where('p.code = :code')
->setParameter('code', $bundleCode)
->getQuery()
->getResult();
}
}
21 changes: 21 additions & 0 deletions src/Repository/ProductBundleItemRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\SyliusProductBundlePlugin\Repository;

use BitBag\SyliusProductBundlePlugin\Entity\ProductBundleItemInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;

interface ProductBundleItemRepositoryInterface extends RepositoryInterface
{
/** @return ProductBundleItemInterface[] */
public function findByBundleCode(string $bundleCode): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
<attribute name="quantity">
<group>shop:cart:add_product_bundle</group>
</attribute>
<attribute name="variantCodes">
<group>shop:cart:add_product_bundle</group>
</attribute>
</class>
</serializer>
1 change: 1 addition & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<import resource="services/controller.xml"/>
<import resource="services/handler.xml"/>
<import resource="services/processor.xml"/>
<import resource="services/provider.xml"/>
<import resource="services/transformer.xml"/>
<import resource="services/twig.xml"/>
<import resource="services/validator.xml"/>
Expand Down
14 changes: 14 additions & 0 deletions src/Resources/config/services/provider.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service
id="bitbag_sylius_product_bundle.provider.add_product_bundle_item_to_cart_command"
class="BitBag\SyliusProductBundlePlugin\Provider\AddProductBundleItemToCartCommandProvider"
>
<argument type="service" id="bitbag_sylius_product_bundle.factory.add_product_bundle_item_to_cart_command"/>
<argument type="service" id="bitbag_sylius_product_bundle.repository.product_bundle_item"/>
</service>
</services>
</container>
1 change: 1 addition & 0 deletions src/Resources/config/services/transformer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
id="bitbag_sylius_product_bundle.data_transformer.add_product_bundle_to_cart_dto"
class="BitBag\SyliusProductBundlePlugin\DataTransformer\AddProductBundleToCartDtoDataTransformer"
>
<argument type="service" id="bitbag_sylius_product_bundle.provider.add_product_bundle_item_to_cart_command"/>
<tag name="api_platform.data_transformer"/>
</service>
</services>
Expand Down

0 comments on commit 3296e11

Please sign in to comment.