mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageImages
synced 2024-11-27 09:42:39 +00:00
Merge "Rely on language-level types for the constructor"
This commit is contained in:
commit
774edf893e
|
@ -46,30 +46,13 @@ class ParserFileProcessingHookHandlers implements
|
|||
{
|
||||
private const CANDIDATE_REGEX = '/<!--MW-PAGEIMAGES-CANDIDATE-([0-9]+)-->/';
|
||||
|
||||
/** @var RepoGroup */
|
||||
private $repoGroup;
|
||||
|
||||
/** @var WANObjectCache */
|
||||
private $mainWANObjectCache;
|
||||
|
||||
/** @var HttpRequestFactory */
|
||||
private $httpRequestFactory;
|
||||
|
||||
/** @var IConnectionProvider */
|
||||
private $connectionProvider;
|
||||
|
||||
/** @var TitleFactory */
|
||||
private $titleFactory;
|
||||
private RepoGroup $repoGroup;
|
||||
private WANObjectCache $mainWANObjectCache;
|
||||
private HttpRequestFactory $httpRequestFactory;
|
||||
private IConnectionProvider $connectionProvider;
|
||||
private TitleFactory $titleFactory;
|
||||
private LinksMigration $linksMigration;
|
||||
|
||||
/**
|
||||
* @param RepoGroup $repoGroup
|
||||
* @param WANObjectCache $mainWANObjectCache
|
||||
* @param HttpRequestFactory $httpRequestFactory
|
||||
* @param IConnectionProvider $connectionProvider
|
||||
* @param TitleFactory $titleFactory
|
||||
* @param LinksMigration $linksMigration
|
||||
*/
|
||||
public function __construct(
|
||||
RepoGroup $repoGroup,
|
||||
WANObjectCache $mainWANObjectCache,
|
||||
|
@ -193,7 +176,7 @@ class ParserFileProcessingHookHandlers implements
|
|||
* Find the best images out of an array of candidates
|
||||
*
|
||||
* @param PageImageCandidate[] $images
|
||||
* @return array The best image, and the best free image
|
||||
* @return array{string|false,string|false} The best image, and the best free image
|
||||
*/
|
||||
private function findBestImages( array $images ) {
|
||||
if ( !$images ) {
|
||||
|
@ -392,9 +375,9 @@ class ParserFileProcessingHookHandlers implements
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns width/height ratio of an image as displayed or 0 is not available
|
||||
* Returns width/height ratio of an image as displayed or 0 if not available
|
||||
*
|
||||
* @param PageImageCandidate $image Array representing the image to get the aspect ratio from
|
||||
* @param PageImageCandidate $image
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue