r40902 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40901‎ | r40902 | r40903 >
Date:06:13, 16 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Fixed documentation. Don't use empty() to determine if an array has zero length, that's not what it does.
Modified paths:
  • /trunk/phase3/includes/filerepo/RepoGroup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/RepoGroup.php
@@ -177,9 +177,11 @@
178178 }
179179
180180 /**
181 - * Run a function across all foreign repos.
182 - * @param $callback string Name of method to call
183 - * @param $params array Optional params to pass to the function
 181+ * Call a function for each foreign repo, with the repo object as the
 182+ * first parameter.
 183+ *
 184+ * @param $callback callback The function to call
 185+ * @param $params array Optional additional parameters to pass to the function
184186 */
185187 function forEachForeignRepo( $callback, $params = array() ) {
186188 foreach( $this->foreignRepos as $repo ) {
@@ -192,11 +194,11 @@
193195 }
194196
195197 /**
196 - * Does the installation have foreign repos set up?
 198+ * Does the installation have any foreign repos set up?
197199 * @return bool
198200 */
199201 function hasForeignRepos() {
200 - return !empty( $this->foreignRepos );
 202+ return (bool)$this->foreignRepos;
201203 }
202204
203205 /**