Passed
Pull Request — master (#87)
by
unknown
03:40
created

VariantPdfModelFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createWithVariantAndImagePath() 0 16 1
1
<?php
2
3
/*
4
 * This file was created by developers working at BitBag
5
 * Do you need more information about us and what we do? Visit our https://bitbag.io website!
6
 * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
7
*/
8
9
declare(strict_types=1);
10
11
namespace BitBag\SyliusWishlistPlugin\Model\Factory;
12
13
use BitBag\SyliusWishlistPlugin\Model\VariantPdfModel;
14
use Sylius\Component\Core\Model\ProductVariantInterface;
15
16
final class VariantPdfModelFactory implements VariantPdfModelFactoryInterface
17
{
18
    public function createWithVariantAndImagePath
19
    (
20
        ProductVariantInterface $variant,
21
        string $path,
22
        int $quantity,
23
        string $actualVariant
24
    ):  VariantPdfModel
25
    {
26
        $productPdfModel = new VariantPdfModel();
27
28
        $productPdfModel->setVariant($variant);
29
        $productPdfModel->setImagePath($path);
30
        $productPdfModel->setQuantity($quantity);
31
        $productPdfModel->setActualVariant($actualVariant);
32
33
        return $productPdfModel;
34
    }
35
}