Skip to content

Commit bc3f7a4

Browse files
[9.x] Adjusts Request::getSession upgrade guide (#7600)
* Adjusts getSession upgrade notes * Update upgrade.md Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 23fbf5c commit bc3f7a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ public function flush($age = null);
543543

544544
The `Symfony\Component\HttpFoundaton\Request` class that is extended by Laravel's own `Illuminate\Http\Request` class offers a `getSession` method to get the current session storage handler. This method is not documented by Laravel as most Laravel applications interact with the session through Laravel's own `session` method.
545545

546-
The `getSession` method previously returned an instance of `Illuminate\Session\Store`; however, due to the Symfony 6.x release enforcing a return type of `Symfony\Component\HttpFoundation\Session\SessionInterface`, the `getSession` now correctly returns a `SessionInterface` implementation.
546+
The `getSession` method previously returned an instance of `Illuminate\Session\Store` or `null`; however, due to the Symfony 6.x release enforcing a return type of `Symfony\Component\HttpFoundation\Session\SessionInterface`, the `getSession` now correctly returns a `SessionInterface` implementation or throws an `\Symfony\Component\HttpFoundation\Exception\SessionNotFoundException` exception when no session is available.
547547

548548
### Testing
549549

0 commit comments

Comments
 (0)