Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
TitleException
0.00% covered (danger)
0.00%
0 / 3
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 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\Parsoid\Utils;
5
6use RuntimeException;
7
8/**
9 * Exception thrown for invalid titles
10 * @note Replaces JS TitleError, because that implies it extends Error rather than Exception
11 */
12class TitleException extends RuntimeException {
13    public $type;
14    public $title;
15
16    public function __construct( string $message, string $type, string $title ) {
17        parent::__construct( $message );
18        $this->type = $type;
19        $this->title = $title;
20    }
21}