Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / session / SessionOverflowException.php
blob5601653357dd9357dd97611c5a0f75eb034342bd
1 <?php
3 namespace MediaWiki\Session;
5 use InvalidArgumentException;
7 /**
8 * OverflowException specific to the SessionManager, used when the request had multiple possible
9 * sessions tied for top priority.
11 * @since 1.34
13 class SessionOverflowException extends \OverflowException {
14 /** @var SessionInfo[] */
15 private $sessionInfos;
17 /**
18 * @param SessionInfo[] $sessionInfos Must have at least two elements
19 * @param string $msg
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;
30 /**
31 * @return SessionInfo[]
33 public function getSessionInfos(): array {
34 return $this->sessionInfos;