Skip to content

Commit 3d202c5

Browse files
tommygnrweaverryan
authored andcommitted
Fix typehint in example code
1 parent bafeaaf commit 3d202c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cookbook/form/form_collections.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,12 @@ for the tags in the ``Task`` class::
428428
{
429429
// ...
430430

431-
public function addTag($tag)
431+
public function addTag(Tag $tag)
432432
{
433433
$this->tags->add($tag);
434434
}
435435

436-
public function removeTag($tag)
436+
public function removeTag(Tag $tag)
437437
{
438438
// ...
439439
}
@@ -539,7 +539,7 @@ we talk about next!).
539539
// src/Acme/TaskBundle/Entity/Task.php
540540

541541
// ...
542-
public function addTag(ArrayCollection $tag)
542+
public function addTag(Tag $tag)
543543
{
544544
$tag->addTask($this);
545545

@@ -593,7 +593,7 @@ Now, you need to put some code into the ``removeTag`` method of ``Task``::
593593
{
594594
// ...
595595

596-
public function removeTag($tag)
596+
public function removeTag(Tag $tag)
597597
{
598598
$this->tags->removeElement($tag);
599599
}

0 commit comments

Comments
 (0)