Skip to content

Commit 012305d

Browse files
committed
Request: Return Session instead of SessionInterface
See #233
1 parent 99a1dc9 commit 012305d

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

stubs/Symfony/Component/HttpFoundation/Request.stub

+5
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ class Request
2626
*/
2727
public $cookies;
2828

29+
/**
30+
* @return \Symfony\Component\HttpFoundation\Session\Session
31+
*/
32+
public function getSession(): SessionInterface;
33+
2934
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php declare(strict_types = 1);
22

3-
use Symfony\Component\HttpFoundation\Session\SessionInterface;
3+
use Symfony\Component\HttpFoundation\Session\Session;
44
use function PHPStan\Testing\assertType;
55

66
/** @var \Symfony\Component\HttpFoundation\Request $request */
77
$request = doRequest();
88

99
$session1 = $request->getSession();
10-
assertType(SessionInterface::class, $request->getSession());
10+
assertType(Session::class, $request->getSession());
1111

1212
if ($request->hasSession()) {
13-
assertType(SessionInterface::class, $request->getSession());
13+
assertType(Session::class, $request->getSession());
1414
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php declare(strict_types = 1);
22

3-
use Symfony\Component\HttpFoundation\Session\SessionInterface;
3+
use Symfony\Component\HttpFoundation\Session\Session;
44
use function PHPStan\Testing\assertType;
55

66
/** @var \Symfony\Component\HttpFoundation\Request $request */
77
$request = doRequest();
88

99
$session1 = $request->getSession();
10-
assertType(SessionInterface::class . '|null', $request->getSession());
10+
assertType(Session::class . '|null', $request->getSession());
1111

1212
if ($request->hasSession()) {
13-
assertType(SessionInterface::class, $request->getSession());
13+
assertType(Session::class, $request->getSession());
1414
}

0 commit comments

Comments
 (0)