Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit3d202c5

Browse files
tommygnrweaverryan
authored andcommitted
Fix typehint in example code
1 parentbafeaaf commit3d202c5

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)

[8]ページ先頭

©2009-2025 Movatter.jp