Skip to content

Commit 8743b0e

Browse files
committed
phpstan level 2
1 parent 40cd7a7 commit 8743b0e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
parameters:
2-
level: 1
2+
level: 2
33
paths:
44
- src

src/EventListener/FlashMessageListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Cookie;
1616
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
1717
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
18+
use Symfony\Component\HttpFoundation\Session\FlashBagAwareSessionInterface;
1819
use Symfony\Component\HttpKernel\Event\ResponseEvent;
1920
use Symfony\Component\HttpKernel\KernelEvents;
2021
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -56,6 +57,9 @@ public function onKernelResponse(ResponseEvent $event): void
5657
} catch (SessionNotFoundException) {
5758
return;
5859
}
60+
if (!($session instanceof FlashBagAwareSessionInterface)) {
61+
return;
62+
}
5963

6064
// Flash messages are stored in the session. If there is none, there
6165
// can't be any flash messages in it. $session->getFlashBag() would

src/EventListener/TagListener.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ public static function getSubscribedEvents(): array
9696
private function getAttributeTags(Request $request): array
9797
{
9898
// Check for _tag request attribute that is set when using Tag attribute
99-
/** @var $tagConfigurations Tag[] */
100-
if (!$tagConfigurations = $request->attributes->get('_tag')) {
99+
/** @var Tag[] $tagConfigurations */
100+
$tagConfigurations = $request->attributes->get('_tag');
101+
if (!$tagConfigurations) {
101102
return [];
102103
}
103104

0 commit comments

Comments
 (0)