default deprecation notice limit to 1.17, so 1.18 and 1.19 notices are not shown...
[lhc/web/wiklou.git] / includes / WatchedItem.php
index 1fd6e31..031b2b4 100644 (file)
@@ -84,6 +84,8 @@ class WatchedItem {
         * @return bool
         */
        public function removeWatch() {
+               wfProfileIn( __METHOD__ );
+
                $success = false;
                $dbw = wfGetDB( DB_MASTER );
                $dbw->delete( 'watchlist',
@@ -112,6 +114,8 @@ class WatchedItem {
                if ( $dbw->affectedRows() ) {
                        $success = true;
                }
+
+               wfProfileOut( __METHOD__ );
                return $success;
        }
 
@@ -129,6 +133,11 @@ class WatchedItem {
 
        /**
         * Handle duplicate entries. Backend for duplicateEntries().
+        *
+        * @param $ot Title
+        * @param $nt Title
+        *
+        * @return bool
         */
        private static function doDuplicateEntries( $ot, $nt ) {        
                $oldnamespace = $ot->getNamespace();
@@ -143,7 +152,7 @@ class WatchedItem {
                );
                # Construct array to replace into the watchlist
                $values = array();
-               while ( $s = $dbw->fetchObject( $res ) ) {
+               foreach ( $res as $s ) {
                        $values[] = array(
                                'wl_user' => $s->wl_user,
                                'wl_namespace' => $newnamespace,