3 namespace MediaWiki\Session
;
5 use InvalidArgumentException
;
8 * OverflowException specific to the SessionManager, used when the request had multiple possible
9 * sessions tied for top priority.
13 class SessionOverflowException
extends \OverflowException
{
14 /** @var SessionInfo[] */
15 private $sessionInfos;
18 * @param SessionInfo[] $sessionInfos Must have at least two elements
20 * @throws \InvalidArgumentException If $sessionInfos has less than 2 elements
22 public function __construct( array $sessionInfos, $msg ) {
23 if ( count( $sessionInfos ) < 2 ) {
24 throw new InvalidArgumentException( 'Expected at least two SessionInfo objects.' );
26 parent
::__construct( $msg );
27 $this->sessionInfos
= $sessionInfos;
31 * @return SessionInfo[]
33 public function getSessionInfos(): array {
34 return $this->sessionInfos
;