File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 13
13
14
14
use Symfony \Component \HttpFoundation \Request ;
15
15
use Symfony \Component \HttpFoundation \RequestStack ;
16
+ use Symfony \Component \HttpFoundation \Session \FlashBagAwareSessionInterface ;
16
17
use Symfony \Component \HttpFoundation \Session \SessionInterface ;
17
18
use Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface ;
18
19
use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
@@ -152,16 +153,12 @@ public function getLocale(): string
152
153
public function getFlashes (string |array $ types = null ): array
153
154
{
154
155
try {
155
- if (null === $ session = $ this ->getSession ()) {
156
- return [];
157
- }
156
+ $ session = $ this ->getSession ();
158
157
} catch (\RuntimeException ) {
159
158
return [];
160
159
}
161
160
162
- // In 7.0 (when symfony/http-foundation: 6.4 is required) this can be updated to
163
- // check if the session is an instance of FlashBagAwareSessionInterface
164
- if (!method_exists ($ session , 'getFlashBag ' )) {
161
+ if (!$ session instanceof FlashBagAwareSessionInterface) {
165
162
return [];
166
163
}
167
164
You can’t perform that action at this time.
0 commit comments