X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMWNamespace.php;h=97dba26b95cac0efc338a8d590f295cf92100ed0;hb=50ea235528289fa3b7b31a2281c6c7683053b7f4;hp=61e34ee9b2822bf8d189ffbf33243775f99904b1;hpb=adae996840b9e782f6e14b21c433a83e37c3a74e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php index 61e34ee9b2..97dba26b95 100644 --- a/includes/MWNamespace.php +++ b/includes/MWNamespace.php @@ -28,7 +28,6 @@ * * These are synonyms for the names given in the language file * Users and translators should not change them - * */ class MWNamespace { @@ -279,12 +278,26 @@ class MWNamespace { } /** - * Can this namespace ever have a talk namespace? + * Does this namespace ever have a talk namespace? + * + * @deprecated since 1.30, use hasTalkNamespace() instead. * * @param int $index Namespace index - * @return bool + * @return bool True if this namespace either is or has a corresponding talk namespace. */ public static function canTalk( $index ) { + return self::hasTalkNamespace( $index ); + } + + /** + * Does this namespace ever have a talk namespace? + * + * @since 1.30 + * + * @param int $index Namespace ID + * @return bool True if this namespace either is or has a corresponding talk namespace. + */ + public static function hasTalkNamespace( $index ) { return $index >= NS_MAIN; } @@ -357,7 +370,7 @@ class MWNamespace { */ public static function getSubjectNamespaces() { return array_filter( - MWNamespace::getValidNamespaces(), + self::getValidNamespaces(), 'MWNamespace::isSubject' ); } @@ -370,7 +383,7 @@ class MWNamespace { */ public static function getTalkNamespaces() { return array_filter( - MWNamespace::getValidNamespaces(), + self::getValidNamespaces(), 'MWNamespace::isTalk' ); }