Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| PageAssertionException | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | */ |
| 6 | |
| 7 | namespace MediaWiki\Page; |
| 8 | |
| 9 | use InvalidArgumentException; |
| 10 | use Throwable; |
| 11 | use Wikimedia\NormalizedException\INormalizedException; |
| 12 | use Wikimedia\NormalizedException\NormalizedExceptionTrait; |
| 13 | |
| 14 | /** |
| 15 | * Exception if a PageIdentity is an invalid argument |
| 16 | * |
| 17 | * @newable |
| 18 | * @since 1.38 |
| 19 | */ |
| 20 | class PageAssertionException extends InvalidArgumentException implements INormalizedException { |
| 21 | |
| 22 | use NormalizedExceptionTrait; |
| 23 | |
| 24 | /** |
| 25 | * @stable to call |
| 26 | * @param string $normalizedMessage The exception message, with PSR-3 style placeholders. |
| 27 | * @param array $messageContext Message context, with values for the placeholders. |
| 28 | * @param int $code The exception code. |
| 29 | * @param Throwable|null $previous The previous throwable used for the exception chaining. |
| 30 | */ |
| 31 | public function __construct( |
| 32 | string $normalizedMessage = '', |
| 33 | array $messageContext = [], |
| 34 | int $code = 0, |
| 35 | ?Throwable $previous = null |
| 36 | ) { |
| 37 | $this->normalizedMessage = $normalizedMessage; |
| 38 | $this->messageContext = $messageContext; |
| 39 | parent::__construct( |
| 40 | self::getMessageFromNormalizedMessage( $normalizedMessage, $messageContext ), |
| 41 | $code, |
| 42 | $previous |
| 43 | ); |
| 44 | } |
| 45 | } |