8000 [Twig Bridge] A simpler way to retrieve flash messages by javiereguiluz · Pull Request #21819 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Twig Bridge] A simpler way to retrieve flash messages #21819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Fixed the condition
  • Loading branch information
javiereguiluz committed Mar 23, 2017
commit c916aee6289b0a31327831fb0136471d814f1888
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/AppVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function getFlashes($types = null)
return array();
}

if (null !== $type || array() === $types) {
if (null === $types || array() === $types) {
return $session->getFlashBag()->all();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should cast $types to an array first:

$type = (array) $type;

Expand Down
0