WishlistProduct   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 17
dl 0
loc 63
rs 10
c 2
b 1
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getWishlist() 0 3 1
A setWishlist() 0 3 1
A __construct() 0 3 1
A getId() 0 3 1
A getQuantity() 0 3 1
A setProduct() 0 3 1
A setVariant() 0 3 1
A getVariant() 0 3 1
A setQuantity() 0 3 1
A getProduct() 0 6 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\Entity;
12
13
use Sylius\Component\Core\Model\ProductInterface;
14
use Sylius\Component\Core\Model\ProductVariantInterface;
15
16
class WishlistProduct implements WishlistProductInterface
17
{
18
    protected ?int $id;
19
20
    protected WishlistInterface $wishlist;
21
22
    protected ?ProductInterface $product = null;
23
24
    protected ?ProductVariantInterface $variant = null;
25
26
    protected int $quantity = 0;
27
28
    public function __construct()
29
    {
30
        $this->id = null;
31
    }
32
33
    public function getId(): ?int
34
    {
35
        return $this->id;
36
    }
37
38
    public function getWishlist(): WishlistInterface
39
    {
40
        return $this->wishlist;
41
    }
42
43
    public function setWishlist(WishlistInterface $wishlist): void
44
    {
45
        $this->wishlist = $wishlist;
46
    }
47
48
    public function getProduct(): ProductInterface
49
    {
50
        /** @var ProductInterface $product */
51
        $product = $this->product;
52
53
        return $product;
54
    }
55
56
    public function setProduct(ProductInterface $product): void
57
    {
58
        $this->product = $product;
59
    }
60
61
    public function getVariant(): ?ProductVariantInterface
62
    {
63
        return $this->variant;
64
    }
65
66
    public function setVariant(?ProductVariantInterface $variant): void
67
    {
68
        $this->variant = $variant;
69
    }
70
71
    public function getQuantity(): int
72
    {
73
        return $this->quantity;
74
    }
75
76
    public function setQuantity(int $quantity): void
77
    {
78
        $this->quantity = $quantity;
79
    }
80
}
81