From 6279d05c91c298f40eea39cf0c8d96107ab64cfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 11 Mar 2021 09:41:21 +0100 Subject: [PATCH] Make SessionHandler::createLegacySession() return the session This does not implicitly modify class properties and thus makes the code cleaner. --- .../files/lib/system/session/SessionHandler.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 10522693f2..ee482a1579 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -659,7 +659,7 @@ final class SessionHandler extends SingletonFactory $this->legacySession = $statement->fetchSingleObject(LegacySession::class); if (!$this->legacySession) { - $this->createLegacySession(); + $this->legacySession = $this->createLegacySession(); } return true; @@ -717,11 +717,11 @@ final class SessionHandler extends SingletonFactory } if (!$this->legacySession) { - $this->createLegacySession(); + $this->legacySession = $this->createLegacySession(); } } - private function createLegacySession() + private function createLegacySession(): LegacySession { $spiderID = $this->getSpiderID(UserUtil::getUserAgent()); @@ -737,7 +737,7 @@ final class SessionHandler extends SingletonFactory 'spiderID' => $spiderID, ]; - $this->legacySession = SessionEditor::create($sessionData); + return SessionEditor::create($sessionData); } /** -- 2.20.1