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

Lines changed: 4 additions & 4 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy