Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Classes/EventListener/Order/Create/PersistOrder/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
*/

use Extcode\Cart\Domain\Model\Cart\AdditionalDataInterface;
use Extcode\Cart\Domain\Model\Cart\BeVariant;
use Extcode\Cart\Domain\Model\Cart\FeVariant;
use Extcode\Cart\Domain\Model\Cart\Product;
use Extcode\Cart\Domain\Model\Cart\BeVariantInterface;
use Extcode\Cart\Domain\Model\Cart\FeVariantInterface;
use Extcode\Cart\Domain\Model\Cart\ProductInterface;
use Extcode\Cart\Domain\Model\Order\Item;
use Extcode\Cart\Domain\Model\Order\Product;
use Extcode\Cart\Domain\Model\Order\ProductAdditional;
use Extcode\Cart\Domain\Repository\Order\ProductAdditionalRepository;
use Extcode\Cart\Domain\Repository\Order\ProductRepository;
Expand Down Expand Up @@ -59,7 +59,7 @@ public function __invoke(PersistOrderEvent $event): void
protected function addProduct(ProductInterface $cartProduct): void
{
$orderProduct = GeneralUtility::makeInstance(
\Extcode\Cart\Domain\Model\Order\Product::class
Product::class
);
$orderProduct->setSku($cartProduct->getSku());
$orderProduct->setTitle($cartProduct->getTitle());
Expand All @@ -86,7 +86,7 @@ protected function addProduct(ProductInterface $cartProduct): void
$this->addFeVariants($orderProduct, $cartProduct->getFeVariant());
}

protected function addProductVariants(Product $product): void
protected function addProductVariants(ProductInterface $product): void
{
foreach ($product->getBeVariants() as $variant) {
if ($variant->getBeVariants()) {
Expand All @@ -98,8 +98,8 @@ protected function addProductVariants(Product $product): void
}

protected function addFeVariants(
\Extcode\Cart\Domain\Model\Order\Product $product,
?FeVariant $feVariant = null
Product $product,
?FeVariantInterface $feVariant = null
): void {
if ($feVariant) {
$feVariantsData = $feVariant->getVariantData();
Expand All @@ -113,7 +113,7 @@ protected function addFeVariants(

protected function addProductAdditional(
string $productAdditionalType,
\Extcode\Cart\Domain\Model\Order\Product $product,
Product $product,
array $feVariant
): void {
$productAdditional = GeneralUtility::makeInstance(
Expand All @@ -130,7 +130,7 @@ protected function addProductAdditional(
$product->addProductAdditional($productAdditional);
}

protected function addVariantsOfVariant(BeVariant $variant, int $level): void
protected function addVariantsOfVariant(BeVariantInterface $variant, int $level): void
{
$level += 1;

Expand All @@ -143,12 +143,12 @@ protected function addVariantsOfVariant(BeVariant $variant, int $level): void
}
}

protected function addBeVariant(BeVariant $variant, int $level): void
protected function addBeVariant(BeVariantInterface $variant, int $level): void
{
$cartProduct = $variant->getProduct();

$orderProduct = GeneralUtility::makeInstance(
\Extcode\Cart\Domain\Model\Order\Product::class
Product::class
);
$orderProduct->setSku($variant->getCompleteSku());
$orderProduct->setTitle($variant->getCompleteTitle());
Expand Down
Loading