From 01d76d32f294ce0c9584b495b4bbaf68d17a8e34 Mon Sep 17 00:00:00 2001 From: johan Vlaar Date: Wed, 9 Aug 2023 13:53:19 +0200 Subject: [PATCH] Update typed property array => ArrayCollection to prevent errors When using strict type checking you could get errors like: ``` TypeError: Cannot assign Doctrine\Common\Collections\ArrayCollection to property App\Entity\Category::$products of type array ``` Co-authored-by: Christian Flothmann --- doctrine/associations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doctrine/associations.rst b/doctrine/associations.rst index b17877c4bdf..09561386d0b 100644 --- a/doctrine/associations.rst +++ b/doctrine/associations.rst @@ -220,7 +220,7 @@ class that will hold these objects: // ... #[ORM\OneToMany(targetEntity: Product::class, mappedBy: 'category')] - private array $products; + private Collection $products; public function __construct() {