diff options
-rw-r--r-- | includes/specials/SpecialMostimages.php | 11 | ||||
-rw-r--r-- | includes/specials/SpecialWantedfiles.php | 25 |
2 files changed, 13 insertions, 23 deletions
diff --git a/includes/specials/SpecialMostimages.php b/includes/specials/SpecialMostimages.php index 4159e16fe837..27c2b683df57 100644 --- a/includes/specials/SpecialMostimages.php +++ b/includes/specials/SpecialMostimages.php @@ -24,7 +24,6 @@ * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com> */ -use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\ILoadBalancer; /** @@ -35,14 +34,10 @@ use Wikimedia\Rdbms\ILoadBalancer; class MostimagesPage extends ImageQueryPage { /** - * @param ILoadBalancer|string $loadBalancer + * @param ILoadBalancer $loadBalancer */ - public function __construct( $loadBalancer ) { - parent::__construct( is_string( $loadBalancer ) ? $loadBalancer : 'Mostimages' ); - // This class is extended and therefor fallback to global state - T265307 - if ( !$loadBalancer instanceof ILoadBalancer ) { - $loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer(); - } + public function __construct( ILoadBalancer $loadBalancer ) { + parent::__construct( 'Mostimages' ); $this->setDBLoadBalancer( $loadBalancer ); } diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index 7e5deb33e064..de02a04329f7 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -25,7 +25,6 @@ */ use MediaWiki\Cache\LinkBatchFactory; -use MediaWiki\MediaWikiServices; use MediaWiki\Page\PageReferenceValue; use Wikimedia\Rdbms\ILoadBalancer; @@ -40,23 +39,19 @@ class WantedFilesPage extends WantedQueryPage { private $repoGroup; /** - * @param RepoGroup|string $repoGroup - * @param ILoadBalancer|null $loadBalancer - * @param LinkBatchFactory|null $linkBatchFactory + * @param RepoGroup $repoGroup + * @param ILoadBalancer $loadBalancer + * @param LinkBatchFactory $linkBatchFactory */ public function __construct( - $repoGroup, - ILoadBalancer $loadBalancer = null, - LinkBatchFactory $linkBatchFactory = null + RepoGroup $repoGroup, + ILoadBalancer $loadBalancer, + LinkBatchFactory $linkBatchFactory ) { - parent::__construct( is_string( $repoGroup ) ? $repoGroup : 'Wantedfiles' ); - // This class is extended and therefor fallback to global state - T265301 - $services = MediaWikiServices::getInstance(); - $this->repoGroup = $repoGroup instanceof RepoGroup - ? $repoGroup - : $services->getRepoGroup(); - $this->setDBLoadBalancer( $loadBalancer ?? $services->getDBLoadBalancer() ); - $this->setLinkBatchFactory( $linkBatchFactory ?? $services->getLinkBatchFactory() ); + parent::__construct( 'Wantedfiles' ); + $this->repoGroup = $repoGroup; + $this->setDBLoadBalancer( $loadBalancer ); + $this->setLinkBatchFactory( $linkBatchFactory ); } protected function getPageHeader() { |