X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FCommentStore.php;h=9969b787821ea9bc45c8b1df717a1b5e1fa68dd7;hp=484b8464dd15639d747af549d2cabe07918dba2d;hb=733704ed8248f71dfb982d22799104a976d1ada4;hpb=03608896716851972cc22d28d432d233be10edba diff --git a/includes/CommentStore.php b/includes/CommentStore.php index 484b8464dd..9969b78782 100644 --- a/includes/CommentStore.php +++ b/includes/CommentStore.php @@ -98,7 +98,7 @@ class CommentStore { /** * @param Language $lang Language to use for comment truncation. Defaults - * to $wgContLang. + * to content language. * @param int $migrationStage One of the MIGRATION_* constants */ public function __construct( Language $lang, $migrationStage ) { @@ -114,10 +114,10 @@ class CommentStore { * @return CommentStore */ public static function newKey( $key ) { - global $wgCommentTableSchemaMigrationStage, $wgContLang; - // TODO uncomment once not used in extensions - // wfDeprecated( __METHOD__, '1.31' ); - $store = new CommentStore( $wgContLang, $wgCommentTableSchemaMigrationStage ); + global $wgCommentTableSchemaMigrationStage; + wfDeprecated( __METHOD__, '1.31' ); + $store = new CommentStore( MediaWikiServices::getInstance()->getContentLanguage(), + $wgCommentTableSchemaMigrationStage ); $store->key = $key; return $store; } @@ -138,7 +138,7 @@ class CommentStore { * @return string */ private function getKey( $methodKey = null ) { - $key = $this->key !== null ? $this->key : $methodKey; + $key = $this->key ?? $methodKey; if ( $key === null ) { // @codeCoverageIgnoreStart throw new InvalidArgumentException( '$key should not be null' );