RCFeed: Use named types instead of exposing internal MW constant
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 4 Jun 2014 04:06:17 +0000 (06:06 +0200)
committerOri.livneh <ori@wikimedia.org>
Wed, 4 Jun 2014 04:55:02 +0000 (04:55 +0000)
Like we do in ApiQueryRecentChanges as well, expose the named
rc.type property, not the internal integer constants.

Change-Id: I89a948eee999032bb2e42cc23345affa879afb42

includes/changes/RecentChange.php
includes/rcfeed/MachineReadableRCFeedFormatter.php

index 370e109..60aba7e 100644 (file)
@@ -147,7 +147,7 @@ class RecentChange {
                        case RC_NEW:
                                $type = 'new';
                                break;
-                       case RC_MOVE:
+                       case RC_MOVE: // obsolete
                                $type = 'move';
                                break;
                        case RC_LOG:
@@ -156,7 +156,7 @@ class RecentChange {
                        case RC_EXTERNAL:
                                $type = 'external';
                                break;
-                       case RC_MOVE_OVER_REDIRECT:
+                       case RC_MOVE_OVER_REDIRECT: // obsolete
                                $type = 'move over redirect';
                                break;
                        default:
index 3f17bcd..d61b6c0 100644 (file)
@@ -46,7 +46,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
                        // but there is no real reason not to expose it in other cases,
                        // and I can see how this may be potentially useful for clients.
                        'id' => $attrib['rc_id'],
-                       'type' => $attrib['rc_type'],
+                       'type' => RecentChange::parseFromRCType( $attrib['rc_type'] ),
                        'namespace' => $rc->getTitle()->getNamespace(),
                        'title' => $rc->getTitle()->getPrefixedText(),
                        'comment' => $attrib['rc_comment'],