Skip to content

Commit 62e20d8

Browse files
committed
fix: Services::session() $config type
1 parent 54cf146 commit 62e20d8

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎system/Config/Services.php‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -661,19 +661,16 @@ public static function security(?SecurityConfig $config = null, bool $getShared
661661
* Return the session manager.
662662
*
663663
* @return Session
664-
*
665-
* @TODO replace the first parameter type `?App` with `?SessionConfig`
666664
*/
667-
public static function session(?App $config = null, bool $getShared = true)
665+
public static function session(?SessionConfig $config = null, bool $getShared = true)
668666
{
669667
if ($getShared) {
670668
return static::getSharedInstance('session', $config);
671669
}
672670

673-
$logger = AppServices::logger();
671+
$config ??= config(SessionConfig::class);
674672

675-
$config = config(SessionConfig::class);
676-
assert($config instanceof SessionConfig, 'Missing "Config/Session.php".');
673+
$logger = AppServices::logger();
677674

678675
$driverName = $config->driver;
679676

‎tests/system/Config/ServicesTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public function testNewViewcell()
243243
*/
244244
public function testNewSession()
245245
{
246-
$actual = Services::session($this->config);
246+
$actual = Services::session();
247247
$this->assertInstanceOf(Session::class, $actual);
248248
}
249249

0 commit comments

Comments
 (0)