It seems like new \Doctrine\Common\Collections\ArrayCollection() of type object<Doctrine\Common\C...ctions\ArrayCollection> is incompatible with the declared type object<Doctrine\Common\C...odel\ProductInterface>> 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...
30
}
31
32
/**
33
* @return Collection|ProductInterface[]
34
*/
35
public function getProducts(): Collection
36
{
37
return $this->products;
38
}
39
40
/**
41
* @param ProductInterface $product
42
*
43
* @return bool
44
*/
45
public function hasProduct(ProductInterface $product): bool
46
{
47
return $this->products->contains($product);
48
}
49
50
/**
51
* @param ProductInterface $product
52
*/
53
public function addProduct(ProductInterface $product): void
54
{
55
$this->products->add($product);
56
}
57
58
/**
59
* @param ProductInterface $product
60
*/
61
public function removeProduct(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..