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