Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ExtensionError
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\Parsoid\Ext;
5
6use Exception;
7use Wikimedia\Parsoid\NodeData\DataMwError;
8
9/**
10 * Exception thrown to halt extension tag content parsing and produce standard
11 * error output.
12 *
13 * $key and $params are basically the arguments to wfMessage, although they
14 * will be stored in the data-mw of the encapsulation wrapper.
15 *
16 * See https://www.mediawiki.org/wiki/Specs/HTML#Error_handling
17 */
18class ExtensionError extends Exception {
19
20    /**
21     * @var DataMwError
22     */
23    public $err;
24
25    /**
26     * @param string $key
27     * @param mixed ...$params
28     */
29    public function __construct(
30        string $key = 'mw-extparse-error', ...$params
31    ) {
32        parent::__construct();
33        $this->err = new DataMwError( $key, $params );
34    }
35
36}