X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsession%2FSessionManager.php;h=a3380ff82f6a0fabb3bb827c8600afa668ca3b2d;hb=5d1b19ed478271f4ef3204f4a388eb39effb275f;hp=c635b971412bfc42851ce6ee14f5c7f6cbb95b2a;hpb=367bc8f7d19e66dfe2d7a326ccf1fcd3629640b4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/SessionManager.php b/includes/session/SessionManager.php index c635b97141..a3380ff82f 100644 --- a/includes/session/SessionManager.php +++ b/includes/session/SessionManager.php @@ -86,8 +86,7 @@ final class SessionManager implements SessionManagerInterface { /** * Get the global SessionManager - * @return SessionManagerInterface - * (really a SessionManager, but this is to make IDEs less confused) + * @return self */ public static function singleton() { if ( self::$instance === null ) { @@ -321,6 +320,7 @@ final class SessionManager implements SessionManagerInterface { public function getVaryHeaders() { // @codeCoverageIgnoreStart + // @phan-suppress-next-line PhanUndeclaredConstant if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) { return []; } @@ -341,6 +341,7 @@ final class SessionManager implements SessionManagerInterface { public function getVaryCookies() { // @codeCoverageIgnoreStart + // @phan-suppress-next-line PhanUndeclaredConstant if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) { return []; } @@ -410,6 +411,7 @@ final class SessionManager implements SessionManagerInterface { $provider->setConfig( $this->config ); $provider->setManager( $this ); if ( isset( $this->sessionProviders[(string)$provider] ) ) { + // @phan-suppress-next-line PhanTypeSuspiciousStringExpression throw new \UnexpectedValueException( "Duplicate provider name \"$provider\"" ); } $this->sessionProviders[(string)$provider] = $provider; @@ -503,11 +505,10 @@ final class SessionManager implements SessionManagerInterface { } if ( count( $retInfos ) > 1 ) { - $ex = new \OverflowException( + throw new SessionOverflowException( + $retInfos, 'Multiple sessions for this request tied for top priority: ' . implode( ', ', $retInfos ) ); - $ex->sessionInfos = $retInfos; - throw $ex; } return $retInfos ? $retInfos[0] : null; @@ -814,6 +815,7 @@ final class SessionManager implements SessionManagerInterface { public function getSessionFromInfo( SessionInfo $info, WebRequest $request ) { // @codeCoverageIgnoreStart if ( defined( 'MW_NO_SESSION' ) ) { + // @phan-suppress-next-line PhanUndeclaredConstant if ( MW_NO_SESSION === 'warn' ) { // Undocumented safety case for converting existing entry points $this->logger->error( 'Sessions are supposed to be disabled for this entry point', [