From: Siebrand Mazeland Date: Thu, 5 Dec 2013 09:13:28 +0000 (+0100) Subject: Add more type hints in comments for static code analysis X-Git-Tag: 1.31.0-rc.0~17755^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=01d41a7ccbc7fbfd4017a86b5dad8ffaaba7a0b3;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;