| 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 $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 |
} |