Documentation and type hinting.
[lhc/web/wiklou.git] / includes / FeedUtils.php
index 072c00b..9daffc1 100644 (file)
@@ -86,8 +86,8 @@ class FeedUtils {
         * @return String
         */
        public static function formatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext='' ) {
-               global $wgFeedDiffCutoff, $wgContLang, $wgUser;
-               wfProfileIn( __FUNCTION__ );
+               global $wgFeedDiffCutoff, $wgLang, $wgUser;
+               wfProfileIn( __METHOD__ );
 
                $skin = $wgUser->getSkin();
                # log enties
@@ -105,12 +105,12 @@ class FeedUtils {
 
                if( $title->getNamespace() >= 0 && !$accErrors && $newid ) {
                        if( $oldid ) {
-                               wfProfileIn( __FUNCTION__."-dodiff" );
+                               wfProfileIn( __METHOD__."-dodiff" );
 
                                #$diffText = $de->getDiff( wfMsg( 'revisionasof',
-                               #       $wgContLang->timeanddate( $timestamp ),
-                               #       $wgContLang->date( $timestamp ),
-                               #       $wgContLang->time( $timestamp ) ),
+                               #       $wgLang->timeanddate( $timestamp ),
+                               #       $wgLang->date( $timestamp ),
+                               #       $wgLang->time( $timestamp ) ),
                                #       wfMsg( 'currentrev' ) );
                                
                                // Don't bother generating the diff if we won't be able to show it
@@ -119,12 +119,12 @@ class FeedUtils {
                                        $diffText = $de->getDiff(
                                                wfMsg( 'previousrevision' ), // hack
                                                wfMsg( 'revisionasof',
-                                                       $wgContLang->timeanddate( $timestamp ),
-                                                       $wgContLang->date( $timestamp ),
-                                                       $wgContLang->time( $timestamp ) ) );
+                                                       $wgLang->timeanddate( $timestamp ),
+                                                       $wgLang->date( $timestamp ),
+                                                       $wgLang->time( $timestamp ) ) );
                                }
 
-                               if ( ( strlen( $diffText ) > $wgFeedDiffCutoff ) || ( $wgFeedDiffCutoff <= 0 ) ) {
+                               if ( $wgFeedDiffCutoff <= 0 || ( strlen( $diffText ) > $wgFeedDiffCutoff ) ) {
                                        // Omit large diffs
                                        $diffLink = $title->escapeFullUrl(
                                                'diff=' . $newid .
@@ -142,7 +142,7 @@ class FeedUtils {
                                        $diffText = UtfNormal::cleanUp( $diffText );
                                        $diffText = self::applyDiffStyle( $diffText );
                                }
-                               wfProfileOut( __FUNCTION__."-dodiff" );
+                               wfProfileOut( __METHOD__."-dodiff" );
                        } else {
                                $rev = Revision::newFromId( $newid );
                                if( is_null( $rev ) ) {
@@ -156,7 +156,7 @@ class FeedUtils {
                        $completeText .= $diffText;
                }
 
-               wfProfileOut( __FUNCTION__ );
+               wfProfileOut( __METHOD__ );
                return $completeText;
        }