Merge "Add .pipeline/ with dev image variant"
[lhc/web/wiklou.git] / includes / session / SessionOverflowException.php
1 <?php
2
3 namespace MediaWiki\Session;
4
5 /**
6 * OverflowException specific to the SessionManager, used when the request had multiple possible
7 * sessions tied for top priority.
8 *
9 * @since 1.34
10 */
11 class SessionOverflowException extends \OverflowException {
12 /** @var SessionInfo[] */
13 private $sessionInfos;
14
15 /**
16 * @param SessionInfo[] $sessionInfos Must have at least two elements
17 * @param string $msg
18 * @throws \InvalidArgumentException If $sessionInfos has less than 2 elements
19 */
20 function __construct( array $sessionInfos, $msg ) {
21 if ( count( $sessionInfos ) < 2 ) {
22 throw new \InvalidArgumentException( 'Expected at least two SessionInfo objects.' );
23 }
24 parent::__construct( $msg );
25 $this->sessionInfos = $sessionInfos;
26 }
27
28 /**
29 * @return SessionInfo[]
30 */
31 public function getSessionInfos() : array {
32 return $this->sessionInfos;
33 }
34 }