Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
MWUnknownContentModelException | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
getModelId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * Exception thrown when an unregistered content model is requested. This error |
4 | * can be triggered by user input, so a separate exception class is provided so |
5 | * callers can substitute a context-specific, internationalised error message. |
6 | * |
7 | * @newable |
8 | * @ingroup Content |
9 | * @since 1.27 |
10 | */ |
11 | class MWUnknownContentModelException extends Exception { |
12 | /** @var string The name of the unknown content model */ |
13 | private $modelId; |
14 | |
15 | /** |
16 | * @stable to call |
17 | * @param string $modelId |
18 | */ |
19 | public function __construct( $modelId ) { |
20 | parent::__construct( "The content model '$modelId' is not registered on this wiki.\n" . |
21 | 'See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions ' . |
22 | 'handle this content model.' ); |
23 | $this->modelId = $modelId; |
24 | } |
25 | |
26 | /** @return string */ |
27 | public function getModelId() { |
28 | return $this->modelId; |
29 | } |
30 | } |