Merge "Make Title::getPageViewLanguage() emit deprecation warnings"
This commit is contained in:
commit
e193c68994
3 changed files with 4 additions and 0 deletions
|
|
@ -407,6 +407,7 @@ because of Phabricator reports.
|
|||
use RestrictionStore::getCreateProtection() instead.
|
||||
* Title::loadRestrictions(), deprecated in 1.37, now emits warnings.
|
||||
* Title::flushRestrictions(), deprecated in 1.37, now emits warnings.
|
||||
* Title::getPageViewLanguage(), deprecated in 1.42, now emits warnings.
|
||||
* The following methods, previously deprecated, now emit deprecation warnings:
|
||||
- ContentHandler::getDefaultModelFor(), deprecated since 1.33
|
||||
- ContentHandler::getAllContentFormats(), deprecated since 1.35
|
||||
|
|
|
|||
|
|
@ -3610,10 +3610,12 @@ class Title implements Stringable, LinkTarget, PageIdentity {
|
|||
* e.g. the user language (such as special pages).
|
||||
*
|
||||
* @deprecated since 1.42 Use ParserOutput::getLanguage instead. See also OutputPage::getContLangForJS.
|
||||
* Hard-deprecated since 1.43.
|
||||
* @since 1.20
|
||||
* @return Language
|
||||
*/
|
||||
public function getPageViewLanguage() {
|
||||
wfDeprecated( __METHOD__, '1.42' );
|
||||
$services = MediaWikiServices::getInstance();
|
||||
|
||||
if ( $this->isSpecialPage() ) {
|
||||
|
|
|
|||
|
|
@ -977,6 +977,7 @@ class TitleTest extends MediaWikiIntegrationTestCase {
|
|||
$this->assertInstanceOf( Title::class, $title,
|
||||
"Test must be passed a valid title text, you gave '$titleText'"
|
||||
);
|
||||
$this->hideDeprecated( Title::class . '::getPageViewLanguage' );
|
||||
$this->assertEquals( $expected,
|
||||
$title->getPageViewLanguage()->getCode(),
|
||||
$msg
|
||||
|
|
|
|||
Loading…
Reference in a new issue