build: Upgrade mediawiki-codesniffer from 26.0.0 to 28.0.0
[lhc/web/wiklou.git] / includes / session / SessionManager.php
index fcc428d..79193d6 100644 (file)
@@ -177,6 +177,7 @@ final class SessionManager implements SessionManagerInterface {
                } else {
                        $store = \ObjectCache::getInstance( $this->config->get( 'SessionCacheType' ) );
                }
+               $this->logger->debug( 'SessionManager using store ' . get_class( $store ) );
                $this->store = $store instanceof CachedBagOStuff ? $store : new CachedBagOStuff( $store );
 
                register_shutdown_function( [ $this, 'shutdown' ] );
@@ -286,7 +287,6 @@ final class SessionManager implements SessionManagerInterface {
                                        "$provider returned empty session info with id flagged unsafe"
                                );
                        }
-                       // @phan-suppress-next-line PhanTypeInvalidDimOffset
                        $compare = $infos ? SessionInfo::compare( $infos[0], $info ) : -1;
                        if ( $compare > 0 ) {
                                continue;
@@ -321,6 +321,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 +342,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 [];
                }
@@ -504,11 +506,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;
@@ -815,6 +816,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', [