Skip to content

Commit

Permalink
[WIP]OP-289: On-hold handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hmfilar committed Sep 13, 2024
1 parent 4c13e4e commit 892447b
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Inventory/Checker/OrderItemAvailabilityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
final class OrderItemAvailabilityChecker implements OrderItemAvailabilityCheckerInterface
{
public function __construct(
private readonly FeatureFlagCheckerInterface $featureFlagChecker,
private readonly OrderItemAvailabilityCheckerInterface $decorated,
private readonly FeatureFlagCheckerInterface $featureFlagChecker,
private readonly ProductBundleOrderItemAvailabilityCheckerInterface $bundleOrderItemAvailabilityChecker,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function areOrderedBundledProductVariantsAvailable(BaseOrderItemInterface
return true;
}

$quantity = $orderItem->getQuantity();
foreach ($orderItem->getProductBundleOrderItems() as $bundleOrderItem) {
$quantity = $orderItem->getQuantity() * $bundleOrderItem->getQuantity();

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.

Check failure on line 27 in src/Inventory/Checker/ProductBundleOrderItemAvailabilityChecker.php

View workflow job for this annotation

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

Only numeric types are allowed in *, int|null given on the right side.
/** @var ProductVariantInterface $variant */
$variant = $bundleOrderItem->getProductVariant();
if (!$variant->isTracked()) {
Expand Down
177 changes: 177 additions & 0 deletions src/Inventory/Operator/OrderInventoryOperator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<?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 hello@bitbag.io.
*/

declare(strict_types=1);

namespace BitBag\SyliusProductBundlePlugin\Inventory\Operator;

use BitBag\SyliusProductBundlePlugin\Entity\OrderItemInterface;
use BitBag\SyliusProductBundlePlugin\Entity\ProductInterface;
use BitBag\SyliusProductBundlePlugin\Inventory\Checker\FeatureFlagCheckerInterface;
use Doctrine\DBAL\LockMode;
use Doctrine\ORM\EntityManagerInterface;
use Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException;
use Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException;
use Sylius\Component\Core\Inventory\Operator\OrderInventoryOperatorInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\OrderItemInterface as BaseOrderItemInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\Component\Core\OrderPaymentStates;

final class OrderInventoryOperator implements OrderInventoryOperatorInterface
{
public function __construct(
private readonly OrderInventoryOperatorInterface $decorated,
private readonly FeatureFlagCheckerInterface $featureFlagChecker,
private readonly EntityManagerInterface $productVariantManager,
private readonly ProductBundleOrderInventoryOperatorInterface $productBundleOrderInventoryOperator,
) {
}

//TODO
public function cancel(OrderInterface $order): void
{
$this->lockOrderProductVariants($order);

if (!$this->featureFlagChecker->isEnabled()) {
$this->decorated->cancel($order);
}

if (in_array(
$order->getPaymentState(),
[OrderPaymentStates::STATE_PAID, OrderPaymentStates::STATE_REFUNDED],
true,
)) {
$this->giveBack($order);

return;
}

$this->release($order);
}

public function hold(OrderInterface $order): void
{
if (!$this->featureFlagChecker->isEnabled()) {
$this->decorated->hold($order);
}

$this->lockOrderProductVariants($order);

//TODO figure out how to split handling bundles and products without copy-pasted code
$this->productBundleOrderInventoryOperator->hold($order);
}

//TODO
public function sell(OrderInterface $order): void
{
$this->lockOrderProductVariants($order);

if (!$this->featureFlagChecker->isEnabled()) {
$this->decorated->sell($order);
}

/** @var BaseOrderItemInterface $orderItem */
foreach ($order->getItems() as $orderItem) {
$variant = $orderItem->getVariant();

if (!$variant->isTracked()) {

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 84 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

if (($variant->getOnHold() - $orderItem->getQuantity()) < 0) {

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 88 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.
throw new NotEnoughUnitsOnHoldException($variant->getName());

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 89 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHoldException constructor expects string, string|null given.
}

if (($variant->getOnHand() - $orderItem->getQuantity()) < 0) {

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 92 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Only numeric types are allowed in -, int|null given on the left side.
throw new NotEnoughUnitsOnHandException($variant->getName());

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

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

Check failure on line 93 in src/Inventory/Operator/OrderInventoryOperator.php

View workflow job for this annotation

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

Parameter #1 $variantName of class Sylius\Component\Core\Inventory\Exception\NotEnoughUnitsOnHandException constructor expects string, string|null given.
}

$variant->setOnHold($variant->getOnHold() - $orderItem->getQuantity());
$variant->setOnHand($variant->getOnHand() - $orderItem->getQuantity());
}
}

/**
* @throws \InvalidArgumentException
*/
//TODO
private function release(OrderInterface $order): void
{
/** @var BaseOrderItemInterface $orderItem */
foreach ($order->getItems() as $orderItem) {
$variant = $orderItem->getVariant();

if (!$variant->isTracked()) {
continue;
}

if (($variant->getOnHold() - $orderItem->getQuantity()) < 0) {
throw new NotEnoughUnitsOnHoldException($variant->getName());
}

$variant->setOnHold($variant->getOnHold() - $orderItem->getQuantity());
}
}

//TODO
private function giveBack(OrderInterface $order): void
{
/** @var BaseOrderItemInterface $orderItem */
foreach ($order->getItems() as $orderItem) {
$variant = $orderItem->getVariant();

if (!$variant->isTracked()) {
continue;
}

$variant->setOnHand($variant->getOnHand() + $orderItem->getQuantity());
}
}

private function lockOrderProductVariants(OrderInterface $order): void
{
/** @var OrderItemInterface $orderItem */
foreach ($order->getItems() as $orderItem) {
$this->lockOrderItemProductVariants($orderItem);
}
}

private function lockOrderItemProductVariants(OrderItemInterface $orderItem): void
{
/** @var ProductInterface $product */
$product = $orderItem->getProduct();
if ($product->isBundle()) {
$this->lockBundledOrderItemProductVariants($orderItem);
} else {
$this->lockOrderItemProductVariant($orderItem);
}
}

private function lockOrderItemProductVariant(OrderItemInterface $orderItem): void
{
$this->lockProductVariant($orderItem->getVariant());
}

private function lockBundledOrderItemProductVariants(OrderItemInterface $orderItem): void
{
foreach ($orderItem->getProductBundleOrderItems() as $bundleOrderItem) {
$this->lockProductVariant($bundleOrderItem->getProductVariant());
}
}

private function lockProductVariant(ProductVariantInterface $variant): void
{
if (!$variant->isTracked()) {
return;
}

$this->productVariantManager->lock($variant, LockMode::OPTIMISTIC, $variant->getVersion());
}
}
45 changes: 45 additions & 0 deletions src/Inventory/Operator/ProductBundleOrderInventoryOperator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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 hello@bitbag.io.
*/

declare(strict_types=1);

namespace BitBag\SyliusProductBundlePlugin\Inventory\Operator;

use BitBag\SyliusProductBundlePlugin\Entity\OrderItemInterface;
use Sylius\Component\Core\Model\OrderInterface;

final class ProductBundleOrderInventoryOperator implements ProductBundleOrderInventoryOperatorInterface
{
public function hold(OrderInterface $order): void
{
/** @var OrderItemInterface $orderItem */
foreach ($order->getItems() as $orderItem) {
$this->holdBundleOrderItems($orderItem);
}
}

public function sell(OrderInterface $order): void
{
// TODO: Implement sell() method.
}

private function holdBundleOrderItems(OrderItemInterface $orderItem): void
{
foreach ($orderItem->getProductBundleOrderItems() as $bundleOrderItem) {
$quantity = $orderItem->getQuantity() * $bundleOrderItem->getQuantity();
$variant = $bundleOrderItem->getProductVariant();

if (!$variant->isTracked()) {
continue;
}

$variant->setOnHold((int)$variant->getOnHold() + $quantity);
}
}
}
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 hello@bitbag.io.
*/

declare(strict_types=1);

namespace BitBag\SyliusProductBundlePlugin\Inventory\Operator;

use Sylius\Component\Core\Model\OrderInterface;

interface ProductBundleOrderInventoryOperatorInterface
{
public function hold(OrderInterface $order): void;

public function sell(OrderInterface $order): void;
}
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/fixture.xml"/>
<import resource="services/controller.xml"/>
<import resource="services/handler.xml"/>
<import resource="services/operator.xml"/>
<import resource="services/processor.xml"/>
<import resource="services/provider.xml"/>
<import resource="services/transformer.xml"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/services/checker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<service id="bitbag_sylius_product_bundle.checker.order_item_availability_checker"
class="BitBag\SyliusProductBundlePlugin\Inventory\Checker\OrderItemAvailabilityChecker"
decorates="sylius.inventory.order_item_availability_checker">
<argument type="service" id="bitbag_sylius_product_bundle.checker.bundled_product_inventory_management_feature_flag_checker"/>
<argument type="service" id="bitbag_sylius_product_bundle.checker.order_item_availability_checker.inner"/>
<argument type="service" id="bitbag_sylius_product_bundle.checker.bundled_product_inventory_management_feature_flag_checker"/>
<argument type="service" id="bitbag_sylius_product_bundle.checker.product_bundle_order_item_availability_checker"/>
</service>
<service id="bitbag_sylius_product_bundle.checker.product_bundle_order_item_availability_checker"
Expand Down
20 changes: 20 additions & 0 deletions src/Resources/config/services/operator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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.operator.order_inventory_operator"
class="BitBag\SyliusProductBundlePlugin\Inventory\Operator\OrderInventoryOperator"
decorates="sylius.custom_inventory.order_inventory_operator">
<argument type="service" id="bitbag_sylius_product_bundle.operator.order_inventory_operator.inner"/>
<argument type="service"
id="bitbag_sylius_product_bundle.checker.bundled_product_inventory_management_feature_flag_checker"/>
<argument type="service" id="sylius.manager.product_variant"/>
<argument type="service"
id="bitbag_sylius_product_bundle.operator.product_bundle_order_inventory_operator"/>
</service>
<service id="bitbag_sylius_product_bundle.operator.product_bundle_order_inventory_operator"
class="BitBag\SyliusProductBundlePlugin\Inventory\Operator\ProductBundleOrderInventoryOperator">
</service>
</services>
</container>

0 comments on commit 892447b

Please sign in to comment.