Merge "Skin: Make skins aware of their registered skin name"
[lhc/web/wiklou.git] / includes / rcfeed / MachineReadableRCFeedFormatter.php
index f524361..a90d648 100644 (file)
@@ -36,11 +36,15 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
        /**
         * Generates a notification that can be easily interpreted by a machine.
         * @see RCFeedFormatter::getLine
+        * @param array $feed
+        * @param RecentChange $rc
+        * @param string|null $actionComment
+        * @return string|null
         */
        public function getLine( array $feed, RecentChange $rc, $actionComment ) {
                global $wgCanonicalServer, $wgServerName, $wgScriptPath;
 
-               $packet = array(
+               $packet = [
                        // Usually, RC ID is exposed only for patrolling purposes,
                        // 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.
@@ -52,7 +56,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
                        'timestamp' => (int)wfTimestamp( TS_UNIX, $rc->getAttribute( 'rc_timestamp' ) ),
                        'user' => $rc->getAttribute( 'rc_user_text' ),
                        'bot' => (bool)$rc->getAttribute( 'rc_bot' ),
-               );
+               ];
 
                if ( isset( $feed['channel'] ) ) {
                        $packet['channel'] = $feed['channel'];
@@ -70,19 +74,19 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
 
                switch ( $type ) {
                        case RC_EDIT:
-                               $packet['length'] = array(
+                               $packet['length'] = [
                                        'old' => $rc->getAttribute( 'rc_old_len' ),
                                        'new' => $rc->getAttribute( 'rc_new_len' )
-                               );
-                               $packet['revision'] = array(
+                               ];
+                               $packet['revision'] = [
                                        'old' => $rc->getAttribute( 'rc_last_oldid' ),
                                        'new' => $rc->getAttribute( 'rc_this_oldid' )
-                               );
+                               ];
                                break;
 
                        case RC_NEW:
-                               $packet['length'] = array( 'old' => null, 'new' => $rc->getAttribute( 'rc_new_len' ) );
-                               $packet['revision'] = array( 'old' => null, 'new' => $rc->getAttribute( 'rc_this_oldid' ) );
+                               $packet['length'] = [ 'old' => null, 'new' => $rc->getAttribute( 'rc_new_len' ) ];
+                               $packet['revision'] = [ 'old' => null, 'new' => $rc->getAttribute( 'rc_this_oldid' ) ];
                                break;
 
                        case RC_LOG:
@@ -98,7 +102,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
                                                $params !== false
                                        ) {
                                                // From ApiQueryLogEvents::addLogParams
-                                               $logParams = array();
+                                               $logParams = [];
                                                // Keys like "4::paramname" can't be used for output so we change them to "paramname"
                                                foreach ( $params as $key => $value ) {
                                                        if ( strpos( $key, ':' ) === false ) {