From 01d41a7ccbc7fbfd4017a86b5dad8ffaaba7a0b3 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Thu, 5 Dec 2013 10:13:28 +0100 Subject: [PATCH] Add more type hints in comments for static code analysis This resolves a little over 100 "undefined method" warnings on includes/filerepo/. Change-Id: I87b6d875a4304d7beadfbc26a66e9a3f358707e6 --- includes/Title.php | 2 +- includes/filerepo/RepoGroup.php | 3 ++- includes/filerepo/file/File.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 2961500531..820842f5b9 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -4696,7 +4696,7 @@ class Title { * Get all extant redirects to this Title * * @param int|Null $ns Single namespace to consider; NULL to consider all namespaces - * @return Array of Title redirects to this title + * @return Title[] Array of Title redirects to this title */ public function getRedirectsHere( $ns = null ) { $redirs = array(); diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index f9b4fb491a..100a11ba77 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -30,7 +30,7 @@ class RepoGroup { /** @var LocalRepo */ protected $localRepo; - /** @var array */ + /** @var FileRepo[] */ protected $foreignRepos; /** @var bool */ @@ -221,6 +221,7 @@ class RepoGroup { if ( $redir ) { return $redir; } + foreach ( $this->foreignRepos as $repo ) { $redir = $repo->checkRedirect( $title ); if ( $redir ) { diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index ab1355931d..7d9e79deac 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -91,7 +91,7 @@ abstract class File { * The following member variables are not lazy-initialised */ - /** @var FileRepo|bool */ + /** @var FileRepo|LocalRepo|ForeignAPIRepo|bool */ public $repo; /** @var Title|string|bool */ @@ -1538,7 +1538,7 @@ abstract class File { /** * Returns the repository * - * @return FileRepo|bool + * @return FileRepo|LocalRepo|bool */ function getRepo() { return $this->repo; -- 2.20.1