r102319 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102318‎ | r102319 | r102320 >
Date:20:22, 7 November 2011
Author:aaron
Status:ok
Tags:
Comment:
* Use 'new self' instead of hard-coded class name
* Added constructor comment
Modified paths:
  • /trunk/phase3/includes/filerepo/UnregisteredLocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/UnregisteredLocalFile.php
@@ -32,7 +32,7 @@
3333 * @return UnregisteredLocalFile
3434 */
3535 static function newFromPath( $path, $mime ) {
36 - return new UnregisteredLocalFile( false, false, $path, $mime );
 36+ return new self( false, false, $path, $mime );
3737 }
3838
3939 /**
@@ -41,10 +41,13 @@
4242 * @return UnregisteredLocalFile
4343 */
4444 static function newFromTitle( $title, $repo ) {
45 - return new UnregisteredLocalFile( $title, $repo, false, false );
 45+ return new self( $title, $repo, false, false );
4646 }
4747
4848 /**
 49+ * Create an UnregisteredLocalFile based on a path or a (title,repo) pair.
 50+ * A FileRepo object is not required here, unlike most other File classes.
 51+ *
4952 * @throws MWException
5053 * @param $title Title|false
5154 * @param $repo FSRepo

Status & tagging log