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