r81378 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81377‎ | r81378 | r81379 >
Date:10:42, 2 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Fixup some trailing newlines

Fixup indentation of a few methods

Add a couple of return type hints
Modified paths:
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromStash.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromUrl.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadStash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromStash.php
@@ -25,24 +25,24 @@
2626 }
2727
2828 public function initialize( $name, $sessionKey, $sessionData ) {
29 - /**
30 - * Confirming a temporarily stashed upload.
31 - * We don't want path names to be forged, so we keep
32 - * them in the session on the server and just give
33 - * an opaque key to the user agent.
34 - */
 29+ /**
 30+ * Confirming a temporarily stashed upload.
 31+ * We don't want path names to be forged, so we keep
 32+ * them in the session on the server and just give
 33+ * an opaque key to the user agent.
 34+ */
3535
36 - $this->initializePathInfo( $name,
37 - $this->getRealPath ( $sessionData['mTempPath'] ),
38 - $sessionData['mFileSize'],
39 - false
40 - );
41 -
42 - $this->mSessionKey = $sessionKey;
43 - $this->mVirtualTempPath = $sessionData['mTempPath'];
44 - $this->mFileProps = $sessionData['mFileProps'];
45 - $this->mSourceType = isset( $sessionData['mSourceType'] ) ?
46 - $sessionData['mSourceType'] : null;
 36+ $this->initializePathInfo( $name,
 37+ $this->getRealPath ( $sessionData['mTempPath'] ),
 38+ $sessionData['mFileSize'],
 39+ false
 40+ );
 41+
 42+ $this->mSessionKey = $sessionKey;
 43+ $this->mVirtualTempPath = $sessionData['mTempPath'];
 44+ $this->mFileProps = $sessionData['mFileProps'];
 45+ $this->mSourceType = isset( $sessionData['mSourceType'] ) ?
 46+ $sessionData['mSourceType'] : null;
4747 }
4848
4949 public function initializeFromRequest( &$request ) {
Index: trunk/phase3/includes/upload/UploadFromUrl.php
@@ -187,7 +187,13 @@
188188 return parent::performUpload( $comment, $pageText, $watch, $user );
189189 }
190190
191 -
 191+ /**
 192+ * @param $comment
 193+ * @param $pageText
 194+ * @param $watch
 195+ * @param $user User
 196+ * @return
 197+ */
192198 protected function insertJob( $comment, $pageText, $watch, $user ) {
193199 $sessionKey = $this->stashSession();
194200 $job = new UploadFromUrlJob( $this->getTitle(), array(
Index: trunk/phase3/includes/upload/UploadBase.php
@@ -1102,7 +1102,7 @@
11031103 * - File exists with normalized extension
11041104 * - The file looks like a thumbnail and the original exists
11051105 *
1106 - * @param $file The File object to check
 1106+ * @param $file File The File object to check
11071107 * @return mixed False if the file does not exists, else an array
11081108 */
11091109 public static function getExistsWarning( $file ) {
Index: trunk/phase3/includes/upload/UploadStash.php
@@ -186,14 +186,12 @@
187187 return true;
188188 }
189189
190 -
191190 /**
192191 * List all files in the stash.
193192 */
194193 public function listFiles() {
195194 return array_keys( $_SESSION[UploadBase::SESSION_KEYNAME] );
196195 }
197 -
198196
199197 /**
200198 * Find or guess extension -- ensuring that our extension matches our mime type.
@@ -269,8 +267,6 @@
270268 throw new UploadStashFileNotFoundException( 'cannot find path, or not a plain file' );
271269 }
272270
273 -
274 -
275271 parent::__construct( false, $repo, $path, false );
276272
277273 $this->name = basename( $this->path );
@@ -346,7 +342,6 @@
347343 return SpecialPage::getTitleFor( 'UploadStash', $subPage )->getLocalURL();
348344 }
349345
350 -
351346 /**
352347 * Get a URL to access the thumbnail
353348 * This is required because the model of how files work requires that
@@ -397,7 +392,6 @@
398393 return $this->getUrl();
399394 }
400395
401 -
402396 /**
403397 * Getter for session key (the session-unique id by which this file's location & metadata is stored in the session)
404398 *
Index: trunk/phase3/includes/filerepo/File.php
@@ -157,6 +157,7 @@
158158
159159 /**
160160 * Return the associated title object
 161+ * @return Title
161162 */
162163 public function getTitle() { return $this->title; }
163164
@@ -269,14 +270,14 @@
270271 /**
271272 * Return true if the file is vectorized
272273 */
273 - public function isVectorized() {
274 - $handler = $this->getHandler();
275 - if ( $handler ) {
276 - return $handler->isVectorized( $this );
277 - } else {
278 - return false;
279 - }
280 - }
 274+ public function isVectorized() {
 275+ $handler = $this->getHandler();
 276+ if ( $handler ) {
 277+ return $handler->isVectorized( $this );
 278+ } else {
 279+ return false;
 280+ }
 281+ }
281282
282283
283284 /**

Status & tagging log