Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
PathConflict | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Rest\PathTemplateMatcher; |
4 | |
5 | use Exception; |
6 | |
7 | /** |
8 | * @newable |
9 | */ |
10 | class PathConflict extends Exception { |
11 | public $newTemplate; |
12 | public $newUserData; |
13 | public $existingTemplate; |
14 | public $existingUserData; |
15 | |
16 | /** |
17 | * @stable to call |
18 | * |
19 | * @param string $template |
20 | * @param mixed $userData |
21 | * @param array $existingNode |
22 | */ |
23 | public function __construct( $template, $userData, $existingNode ) { |
24 | $this->newTemplate = $template; |
25 | $this->newUserData = $userData; |
26 | $this->existingTemplate = $existingNode['template']; |
27 | $this->existingUserData = $existingNode['userData']; |
28 | parent::__construct( "Unable to add path template \"$template\" since it conflicts " . |
29 | "with the existing template \"{$this->existingTemplate}\"" ); |
30 | } |
31 | } |