composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 The following sniffs now pass and were enabled: * Generic.ControlStructures.InlineControlStructure * MediaWiki.PHPUnit.AssertCount.NotUsed npm: * svgo: 2.3.0 → 2.3.1 * https://npmjs.com/advisories/1754 (CVE-2021-33587) Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
34 lines
870 B
PHP
34 lines
870 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Session;
|
|
|
|
/**
|
|
* OverflowException specific to the SessionManager, used when the request had multiple possible
|
|
* sessions tied for top priority.
|
|
*
|
|
* @since 1.34
|
|
*/
|
|
class SessionOverflowException extends \OverflowException {
|
|
/** @var SessionInfo[] */
|
|
private $sessionInfos;
|
|
|
|
/**
|
|
* @param SessionInfo[] $sessionInfos Must have at least two elements
|
|
* @param string $msg
|
|
* @throws \InvalidArgumentException If $sessionInfos has less than 2 elements
|
|
*/
|
|
public function __construct( array $sessionInfos, $msg ) {
|
|
if ( count( $sessionInfos ) < 2 ) {
|
|
throw new \InvalidArgumentException( 'Expected at least two SessionInfo objects.' );
|
|
}
|
|
parent::__construct( $msg );
|
|
$this->sessionInfos = $sessionInfos;
|
|
}
|
|
|
|
/**
|
|
* @return SessionInfo[]
|
|
*/
|
|
public function getSessionInfos(): array {
|
|
return $this->sessionInfos;
|
|
}
|
|
}
|