The expression return $this->products could return the type Loevgaard\SyliusBrandPlu...odel\ProductInterface[] which is incompatible with the type-hinted return Doctrine\Common\Collections\Collection. Consider adding an additional type-check to rule them out.
Loading history...
30
}
31
32
/**
33
* {@inheritdoc}
34
*/
35
public function hasProduct(BrandAwareInterface $product): bool
36
{
37
return $this->products->contains($product);
38
}
39
40
/**
41
* {@inheritdoc}
42
*/
43
public function addProduct(BrandAwareInterface $product): void
Accessing products on the interface Loevgaard\SyliusBrandPlu...\ProductsAwareInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
49
}
50
}
51
52
/**
53
* {@inheritdoc}
54
*/
55
public function removeProduct(BrandAwareInterface $product): void