Skip to content

Commit

Permalink
Revert wrong typehint for getSession
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and ondrejmirtes committed Jan 15, 2023
1 parent fca0834 commit d89a521
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions stubs/Symfony/Component/HttpFoundation/Request.stub
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class Request
*/
public $cookies;

/**
* @return \Symfony\Component\HttpFoundation\Session\Session
*/
public function getSession();

/**
* @return string[]
*/
Expand Down
6 changes: 3 additions & 3 deletions tests/Type/Symfony/data/request_get_session.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php declare(strict_types = 1);

use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use function PHPStan\Testing\assertType;

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

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

if ($request->hasSession()) {
assertType(Session::class, $request->getSession());
assertType(SessionInterface::class, $request->getSession());
}
6 changes: 3 additions & 3 deletions tests/Type/Symfony/data/request_get_session_null.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php declare(strict_types = 1);

use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use function PHPStan\Testing\assertType;

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

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

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

0 comments on commit d89a521

Please sign in to comment.