Skip to content

Commit 53f3666

Browse files
committed
minor #18727 Update typed property array => ArrayCollection to prevent errors (johanadivare)
This PR was merged into the 6.3 branch. Discussion ---------- 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 ``` Commits ------- 01d76d3 Update typed property array => ArrayCollection to prevent errors
2 parents 408dd54 + 01d76d3 commit 53f3666

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: doctrine/associations.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class that will hold these objects:
220220
// ...
221221
222222
#[ORM\OneToMany(targetEntity: Product::class, mappedBy: 'category')]
223-
private array $products;
223+
private Collection $products;
224224
225225
public function __construct()
226226
{

0 commit comments

Comments
 (0)