Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3d202c5

Browse filesBrowse files
tommygnrweaverryan
authored andcommitted
Fix typehint in example code
1 parent bafeaaf commit 3d202c5
Copy full SHA for 3d202c5

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎cookbook/form/form_collections.rst

Copy file name to clipboardExpand all lines: cookbook/form/form_collections.rst
+4-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.