Skip to content

Commit 877f570

Browse files
committed
Update getSession usages
1 parent 86bcb6f commit 877f570

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

src/Illuminate/Http/Request.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use RuntimeException;
1212
use Symfony\Component\HttpFoundation\ParameterBag;
1313
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
14-
use Symfony\Component\HttpFoundation\Session\SessionInterface;
1514

1615
/**
1716
* @method array validate(array $rules, ...$params)
@@ -405,8 +404,8 @@ public static function createFrom(self $from, $to = null)
405404

406405
$request->setJson($from->json());
407406

408-
if ($from->hasSession()) {
409-
$request->setLaravelSession($from->getSession());
407+
if ($from->hasSession() && $session = $from->getSession()) {
408+
$request->setLaravelSession($session);
410409
}
411410

412411
$request->setUserResolver($from->getUserResolver());
@@ -489,16 +488,6 @@ public function session()
489488
return $this->session;
490489
}
491490

492-
/**
493-
* Get the session associated with the request.
494-
*
495-
* @return \Illuminate\Session\Store
496-
*/
497-
public function getSession(): SessionInterface
498-
{
499-
return $this->session;
500-
}
501-
502491
/**
503492
* Set the session instance on the request.
504493
*

src/Illuminate/Testing/TestResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ protected function statusMessageWithDetails($expected, $actual)
186186
}
187187

188188
if ($this->baseResponse instanceof RedirectResponse) {
189-
$session = $this->baseResponse->getSession();
189+
$session = $this->baseResponse->session();
190190

191191
if (! is_null($session) && $session->has('errors')) {
192192
return $this->statusMessageWithErrors($expected, $actual, $session->get('errors')->all());

0 commit comments

Comments
 (0)