Remove deprecated wfLocalFile and wfFindFile

Bug: T249020
Change-Id: I9988e0abcec39ec0c6e92a92d40363a45483f016
This commit is contained in:
Umherirrender 2022-07-07 20:44:13 +02:00
parent 7f0484c737
commit 51f9040be4
3 changed files with 1 additions and 39 deletions

View file

@ -336,6 +336,7 @@ because of Phabricator reports.
- ::buildGroupConcatField()
* SpecialUnblock::processUnblock(), deprecated in 1.36, has been removed. Use
UnblockUser instead.
* wfLocalFile() and wfFindFile(), deprecated in 1.34, have been removed.
* …
=== Deprecations in 1.39 ===

View file

@ -24,7 +24,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
die( "This file is part of MediaWiki, it is not a valid entry point" );
}
use MediaWiki\Linker\LinkTarget;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use MediaWiki\ProcOpenError;
@ -1955,31 +1954,6 @@ function wfGetDB( $db, $groups = [], $wiki = false ) {
}
}
/**
* Find a file.
* @deprecated since 1.34, use MediaWikiServices
* @param string|LinkTarget $title
* @param array $options Associative array of options (see RepoGroup::findFile)
* @return File|bool File, or false if the file does not exist
*/
function wfFindFile( $title, $options = [] ) {
wfDeprecated( __FUNCTION__, '1.34' );
return MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title, $options );
}
/**
* Get an object referring to a locally registered file.
* Returns a valid placeholder object if the file does not exist.
*
* @deprecated since 1.34, hard deprecated since 1.37, use MediaWikiServices
* @param Title|string $title
* @return LocalFile|null A File, or null if passed an invalid Title
*/
function wfLocalFile( $title ) {
wfDeprecated( __FUNCTION__, '1.34' );
return MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()->newFile( $title );
}
/**
* Should low-performance queries be disabled?
*

View file

@ -285,19 +285,6 @@ class LocalFileTest extends MediaWikiIntegrationTestCase {
];
}
/**
* @covers ::wfLocalFile
*/
public function testWfLocalFile() {
$this->hideDeprecated( 'wfLocalFile' );
$file = wfLocalFile( "File:Some_file_that_probably_doesn't exist.png" );
$this->assertInstanceOf(
LocalFile::class,
$file,
'wfLocalFile() returns LocalFile for valid Titles'
);
}
/**
* @covers LocalFile::getUploader
*/