mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-27 09:43:06 +00:00
MWException -> Exception
Change-Id: Ifcb11e0f7f11f41d657339bf2651ae481816115b
This commit is contained in:
parent
5c731f287e
commit
d6b0a4cdf4
|
@ -485,4 +485,4 @@ $specialPageAliases['zh-hant'] = array(
|
||||||
/** Chinese (Taiwan) (中文(台灣)) */
|
/** Chinese (Taiwan) (中文(台灣)) */
|
||||||
$specialPageAliases['zh-tw'] = array(
|
$specialPageAliases['zh-tw'] = array(
|
||||||
'CategoryTree' => array( '分類樹' ),
|
'CategoryTree' => array( '分類樹' ),
|
||||||
);
|
);
|
||||||
|
|
|
@ -249,4 +249,4 @@ $magicWords['zh-hans'] = array(
|
||||||
/** Traditional Chinese (中文(繁體)) */
|
/** Traditional Chinese (中文(繁體)) */
|
||||||
$magicWords['zh-hant'] = array(
|
$magicWords['zh-hant'] = array(
|
||||||
'categorytree' => array( 0, '分類樹' ),
|
'categorytree' => array( 0, '分類樹' ),
|
||||||
);
|
);
|
||||||
|
|
|
@ -242,7 +242,7 @@ class CategoryTree {
|
||||||
* @param $options
|
* @param $options
|
||||||
* @param $enc
|
* @param $enc
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws MWException
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
static function encodeOptions( $options, $enc ) {
|
static function encodeOptions( $options, $enc ) {
|
||||||
if ( $enc == 'mode' || $enc == '' ) {
|
if ( $enc == 'mode' || $enc == '' ) {
|
||||||
|
@ -250,7 +250,7 @@ class CategoryTree {
|
||||||
} elseif ( $enc == 'json' ) {
|
} elseif ( $enc == 'json' ) {
|
||||||
$opt = FormatJson::encode( $options );
|
$opt = FormatJson::encode( $options );
|
||||||
} else {
|
} else {
|
||||||
throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc );
|
throw new Exception( 'Unknown encoding for CategoryTree options: ' . $enc );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $opt;
|
return $opt;
|
||||||
|
@ -260,7 +260,7 @@ class CategoryTree {
|
||||||
* @param $options
|
* @param $options
|
||||||
* @param $enc
|
* @param $enc
|
||||||
* @return array|mixed
|
* @return array|mixed
|
||||||
* @throws MWException
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
static function decodeOptions( $options, $enc ) {
|
static function decodeOptions( $options, $enc ) {
|
||||||
if ( $enc == 'mode' || $enc == '' ) {
|
if ( $enc == 'mode' || $enc == '' ) {
|
||||||
|
@ -268,11 +268,11 @@ class CategoryTree {
|
||||||
} elseif ( $enc == 'json' ) {
|
} elseif ( $enc == 'json' ) {
|
||||||
$opt = FormatJson::decode( $options );
|
$opt = FormatJson::decode( $options );
|
||||||
if ( !$opt ) {
|
if ( !$opt ) {
|
||||||
throw new MWException( 'JSON cannot decode CategoryTree options' );
|
throw new Exception( 'JSON cannot decode CategoryTree options' );
|
||||||
}
|
}
|
||||||
$opt = get_object_vars( $opt );
|
$opt = get_object_vars( $opt );
|
||||||
} else {
|
} else {
|
||||||
throw new MWException( 'Unknown encoding for CategoryTree options: ' . $enc );
|
throw new Exception( 'Unknown encoding for CategoryTree options: ' . $enc );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $opt;
|
return $opt;
|
||||||
|
|
Loading…
Reference in a new issue