/**
* 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 ) {
public function getVaryHeaders() {
// @codeCoverageIgnoreStart
+ // @phan-suppress-next-line PhanUndeclaredConstant
if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) {
return [];
}
public function getVaryCookies() {
// @codeCoverageIgnoreStart
+ // @phan-suppress-next-line PhanUndeclaredConstant
if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) {
return [];
}
$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;
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', [