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