Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: Idf17719c875466810313f0fbbf16bc67f3e40059
35 lines
833 B
PHP
35 lines
833 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Rest\PathTemplateMatcher;
|
|
|
|
use Exception;
|
|
|
|
/**
|
|
* @newable
|
|
*/
|
|
class PathConflict extends Exception {
|
|
/** @var string */
|
|
public $newTemplate;
|
|
/** @var mixed */
|
|
public $newUserData;
|
|
/** @var string */
|
|
public $existingTemplate;
|
|
/** @var mixed */
|
|
public $existingUserData;
|
|
|
|
/**
|
|
* @stable to call
|
|
*
|
|
* @param string $template
|
|
* @param mixed $userData
|
|
* @param array $existingNode
|
|
*/
|
|
public function __construct( $template, $userData, $existingNode ) {
|
|
$this->newTemplate = $template;
|
|
$this->newUserData = $userData;
|
|
$this->existingTemplate = $existingNode['template'];
|
|
$this->existingUserData = $existingNode['userData'];
|
|
parent::__construct( "Unable to add path template \"$template\" since it conflicts " .
|
|
"with the existing template \"{$this->existingTemplate}\"" );
|
|
}
|
|
}
|