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 1da4252

Browse filesBrowse files
minor #27765 [HttpFoundation] update phpdoc of FlashBagInterface::add() (sir-kain)
This PR was squashed before being merged into the 2.8 branch (closes #27765). Discussion ---------- [HttpFoundation] update phpdoc of FlashBagInterface::add() | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - **Reason why I propose to change the docblock like this: ** The `FlashBagInterface::add()` function does not work only with the `string` type in second parameter Commits ------- 9135e18 [HttpFoundation] update phpdoc of FlashBagInterface::add()
2 parents 6e5c15d + 9135e18 commit 1da4252
Copy full SHA for 1da4252

File tree

2 files changed

+13
-1
lines changed
Filter options

2 files changed

+13
-1
lines changed

‎src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface FlashBagInterface extends SessionBagInterface
2424
* Adds a flash message for type.
2525
*
2626
* @param string $type
27-
* @param string $message
27+
* @param mixed $message
2828
*/
2929
public function add($type, $message);
3030

‎src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ public function testPeek()
7474
$this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
7575
}
7676

77+
public function testAdd()
78+
{
79+
$tab = array('bar' => 'baz');
80+
$this->bag->add('string_message', 'lorem');
81+
$this->bag->add('object_message', new \stdClass());
82+
$this->bag->add('array_message', $tab);
83+
84+
$this->assertEquals(array('lorem'), $this->bag->get('string_message'));
85+
$this->assertEquals(array(new \stdClass()), $this->bag->get('object_message'));
86+
$this->assertEquals(array($tab), $this->bag->get('array_message'));
87+
}
88+
7789
public function testGet()
7890
{
7991
$this->assertEquals(array(), $this->bag->get('non_existing'));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.