Add more type hints in comments for static code analysis
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Thu, 5 Dec 2013 09:13:28 +0000 (10:13 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Thu, 5 Dec 2013 23:23:05 +0000 (00:23 +0100)
This resolves a little over 100 "undefined method" warnings on
includes/filerepo/.

Change-Id: I87b6d875a4304d7beadfbc26a66e9a3f358707e6

includes/Title.php
includes/filerepo/RepoGroup.php
includes/filerepo/file/File.php

index 2961500..820842f 100644 (file)
@@ -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();
index f9b4fb4..100a11b 100644 (file)
@@ -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 ) {
index ab13559..7d9e79d 100644 (file)
@@ -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;