Merge "Have Linker::normaliseSpecialPage() accept LinkTarget objects"
[lhc/web/wiklou.git] / includes / WatchedItemStore.php
index 8ae7932..fcf6d3b 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
+use MediaWiki\Linker\LinkTarget;
 use Wikimedia\Assert\Assert;
 
 /**
@@ -620,7 +621,7 @@ class WatchedItemStore implements StatsdAwareInterface {
                $this->reuseConnection( $dbr );
 
                foreach ( $res as $row ) {
-                       $timestamps[(int)$row->wl_namespace][$row->wl_title] = $row->wl_notificationtimestamp;
+                       $timestamps[$row->wl_namespace][$row->wl_title] = $row->wl_notificationtimestamp;
                }
 
                return $timestamps;
@@ -905,12 +906,8 @@ class WatchedItemStore implements StatsdAwareInterface {
         * @param LinkTarget $newTarget
         */
        public function duplicateAllAssociatedEntries( LinkTarget $oldTarget, LinkTarget $newTarget ) {
-               if ( !$oldTarget instanceof Title ) {
-                       $oldTarget = Title::newFromLinkTarget( $oldTarget );
-               }
-               if ( !$newTarget instanceof Title ) {
-                       $newTarget = Title::newFromLinkTarget( $newTarget );
-               }
+               $oldTarget = Title::newFromLinkTarget( $oldTarget );
+               $newTarget = Title::newFromLinkTarget( $newTarget );
 
                $this->duplicateEntry( $oldTarget->getSubjectPage(), $newTarget->getSubjectPage() );
                $this->duplicateEntry( $oldTarget->getTalkPage(), $newTarget->getTalkPage() );