It seems like new \Doctrine\Common\Collections\ArrayCollection() of type object<Doctrine\Common\C...ctions\ArrayCollection> is incompatible with the declared type array<integer,object<Syl...Collections\Collection> of property $products.
Our type inference engine has found an assignment to a property that is incompatible
with the declared type of that property.
Either this assignment is in error or the assigned type should be added
to the documentation/type hint for that property..
Loading history...
37
}
38
39
public function getId(): int
40
{
41
return $this->id;
42
}
43
44
public function getName(): string
45
{
46
return $this->name;
47
}
48
49
public function setName(string $name): void
50
{
51
$this->name = $name;
52
}
53
54
public function getPosition(): int
55
{
56
return $this->position;
57
}
58
59
public function setPosition(int $position): void
60
{
61
$this->position = $position;
62
}
63
64
public function getBundle(): ?ProductBundleInterface
65
{
66
return $this->bundle;
67
}
68
69
public function setBundle(ProductBundleInterface $bundle): void
70
{
71
$this->bundle = $bundle;
72
}
73
74
public function getProducts(): Collection
75
{
76
return $this->products;
77
}
78
79
public function addProduct(ProductInterface $product): void
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..