Merge "Use line comments for @codingStandardsIgnoreStart"
[lhc/web/wiklou.git] / includes / Title.php
index b347edb..8e5fae9 100644 (file)
@@ -206,7 +206,7 @@ class Title {
         * @return TitleFormatter
         */
        private static function getTitleFormatter() {
-               //NOTE: we know that getTitleParser() returns a MediaWikiTitleCodec,
+               // NOTE: we know that getTitleParser() returns a MediaWikiTitleCodec,
                //      which implements TitleFormatter.
                return self::getTitleParser();
        }
@@ -266,7 +266,11 @@ class Title {
                        throw new InvalidArgumentException( '$text must be a string.' );
                } elseif ( !is_string( $text ) ) {
                        wfDebugLog( 'T76305', wfGetAllCallers( 5 ) );
-                       wfWarn( __METHOD__ . ': $text must be a string. This will throw an InvalidArgumentException in future.', 2 );
+                       wfWarn(
+                               __METHOD__ . ': $text must be a string. ' .
+                                       'This will throw an InvalidArgumentException in future.',
+                               2
+                       );
                }
 
                try {
@@ -526,7 +530,7 @@ class Title {
         * @param string $title Database key form
         * @param string $fragment The link fragment (after the "#")
         * @param string $interwiki Interwiki prefix
-        * @return Title The new object, or null on an error
+        * @return Title|null The new object, or null on an error
         */
        public static function makeTitleSafe( $ns, $title, $fragment = '', $interwiki = '' ) {
                if ( !MWNamespace::exists( $ns ) ) {
@@ -2944,7 +2948,7 @@ class Title {
                                        $this->mRestrictions['move'] = explode( ',', trim( $temp[0] ) );
                                } else {
                                        $restriction = trim( $temp[1] );
-                                       if ( $restriction != '' ) { //some old entries are empty
+                                       if ( $restriction != '' ) { // some old entries are empty
                                                $this->mRestrictions[$temp[0]] = explode( ',', $restriction );
                                        }
                                }
@@ -4379,7 +4383,7 @@ class Title {
        /**
         * Updates page_touched for this page; called from LinksUpdate.php
         *
-        * @param integer $purgeTime TS_MW timestamp [optional]
+        * @param string $purgeTime [optional] TS_MW timestamp
         * @return bool True if the update succeeded
         */
        public function invalidateCache( $purgeTime = null ) {
@@ -4414,19 +4418,16 @@ class Title {
         * on the number of links. Typically called on create and delete.
         */
        public function touchLinks() {
-               $u = new HTMLCacheUpdate( $this, 'pagelinks' );
-               $u->doUpdate();
-
+               DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'pagelinks' ) );
                if ( $this->getNamespace() == NS_CATEGORY ) {
-                       $u = new HTMLCacheUpdate( $this, 'categorylinks' );
-                       $u->doUpdate();
+                       DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'categorylinks' ) );
                }
        }
 
        /**
         * Get the last touched timestamp
         *
-        * @param DatabaseBase $db Optional db
+        * @param IDatabase $db Optional db
         * @return string Last-touched timestamp
         */
        public function getTouched( $db = null ) {