hasFlash was deprecated in Symfony 2.1

hasFlash was deprecated in Symfony 2.1 and will be removed in 2.3

BC: This code won't work with Symfony <2.1