Add missing @param and @return documentation
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index 35f8b3b..f123363 100644 (file)
@@ -130,7 +130,7 @@ class RecentChange {
                if ( is_array( $type ) ) {
                        $retval = [];
                        foreach ( $type as $t ) {
-                               $retval[] = RecentChange::parseToRCType( $t );
+                               $retval[] = self::parseToRCType( $t );
                        }
 
                        return $retval;
@@ -426,6 +426,7 @@ class RecentChange {
         * @since 1.22
         * @deprecated since 1.29 Use RCFeed::factory() instead
         * @param string $uri URI to get the engine object for
+        * @param array $params
         * @return RCFeedEngine The engine object
         * @throws MWException
         */
@@ -459,7 +460,7 @@ class RecentChange {
 
                $change = $change instanceof RecentChange
                        ? $change
-                       : RecentChange::newFromId( $change );
+                       : self::newFromId( $change );
 
                if ( !$change instanceof RecentChange ) {
                        return null;
@@ -552,9 +553,9 @@ class RecentChange {
         * Makes an entry in the database corresponding to an edit
         *
         * @param string $timestamp
-        * @param Title $title
+        * @param Title &$title
         * @param bool $minor
-        * @param User $user
+        * @param User &$user
         * @param string $comment
         * @param int $oldId
         * @param string $lastTimestamp
@@ -629,9 +630,9 @@ class RecentChange {
         * Note: the title object must be loaded with the new id using resetArticleID()
         *
         * @param string $timestamp
-        * @param Title $title
+        * @param Title &$title
         * @param bool $minor
-        * @param User $user
+        * @param User &$user
         * @param string $comment
         * @param bool $bot
         * @param string $ip
@@ -699,8 +700,8 @@ class RecentChange {
 
        /**
         * @param string $timestamp
-        * @param Title $title
-        * @param User $user
+        * @param Title &$title
+        * @param User &$user
         * @param string $actionComment
         * @param string $ip
         * @param string $type
@@ -730,8 +731,8 @@ class RecentChange {
 
        /**
         * @param string $timestamp
-        * @param Title $title
-        * @param User $user
+        * @param Title &$title
+        * @param User &$user
         * @param string $actionComment
         * @param string $ip
         * @param string $type
@@ -911,7 +912,16 @@ class RecentChange {
        public function loadFromRow( $row ) {
                $this->mAttribs = get_object_vars( $row );
                $this->mAttribs['rc_timestamp'] = wfTimestamp( TS_MW, $this->mAttribs['rc_timestamp'] );
-               $this->mAttribs['rc_deleted'] = $row->rc_deleted; // MUST be set
+               // rc_deleted MUST be set
+               $this->mAttribs['rc_deleted'] = $row->rc_deleted;
+
+               if ( isset( $this->mAttribs['rc_ip'] ) ) {
+                       // Clean up CIDRs for Postgres per T164898. ("127.0.0.1" casts to "127.0.0.1/32")
+                       $n = strpos( $this->mAttribs['rc_ip'], '/' );
+                       if ( $n !== false ) {
+                               $this->mAttribs['rc_ip'] = substr( $this->mAttribs['rc_ip'], 0, $n );
+                       }
+               }
        }
 
        /**