Get rid of Title::indexTitle and Title::getIndexTitle()
[lhc/web/wiklou.git] / includes / FileDeleteForm.php
index 9fc70eb..444d26f 100644 (file)
@@ -48,7 +48,7 @@ class FileDeleteForm {
        /**
         * Constructor
         *
-        * @param $file File object we're deleting
+        * @param File $file File object we're deleting
         */
        public function __construct( $file ) {
                $this->title = $file->getTitle();
@@ -120,13 +120,7 @@ class FileDeleteForm {
                                // file, otherwise go back to the description page
                                $wgOut->addReturnTo( $this->oldimage ? $this->title : Title::newMainPage() );
 
-                               if ( $wgUser->isLoggedIn() && $wgRequest->getCheck( 'wpWatch' ) != $wgUser->isWatched( $this->title ) ) {
-                                       if ( $wgRequest->getCheck( 'wpWatch' ) ) {
-                                               WatchAction::doWatch( $this->title, $wgUser );
-                                       } else {
-                                               WatchAction::doUnwatch( $this->title, $wgUser );
-                                       }
-                               }
+                               WatchAction::doWatchOrUnwatch( $wgRequest->getCheck( 'wpWatch' ), $this->title, $wgUser );
                        }
                        return;
                }
@@ -138,12 +132,12 @@ class FileDeleteForm {
        /**
         * Really delete the file
         *
-        * @param $title Title object
-        * @param File $file: file object
-        * @param string $oldimage archive name
-        * @param string $reason reason of the deletion
-        * @param $suppress Boolean: whether to mark all deleted versions as restricted
-        * @param $user User object performing the request
+        * @param Title $title
+        * @param File $file
+        * @param string $oldimage Archive name
+        * @param string $reason Reason of the deletion
+        * @param bool $suppress Whether to mark all deleted versions as restricted
+        * @param User $user User object performing the request
         * @throws MWException
         * @return bool|Status
         */