r95040 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95039‎ | r95040 | r95041 >
Date:20:55, 19 August 2011
Author:khorn
Status:ok
Tags:
Comment:
Stylistic change to the mergeArrayDeafults function in ContributionTracking.
r94720
Modified paths:
  • /trunk/extensions/ContributionTracking/ContributionTracking.processor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionTracking/ContributionTracking.processor.php
@@ -269,15 +269,16 @@
270270 * @return array
271271 */
272272 static function mergeArrayDefaults( $params, $defaults, $nullify=false ) {
273 - foreach ( $defaults as $key => $value ) {
 273+ $ret = $defaults;
 274+ foreach ( $ret as $key => $value ) {
274275 if ( array_key_exists( $key, $params ) ) {
275 - $defaults[$key] = $params[$key];
 276+ $ret[$key] = $params[$key];
276277 }
277 - if ( $nullify && $defaults[$key] === '' ) {
278 - $defaults[$key] = null;
 278+ if ( $nullify && $ret[$key] === '' ) {
 279+ $ret[$key] = null;
279280 }
280281 }
281 - return $defaults;
 282+ return $ret;
282283 }
283284
284285 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94720In the process of adding an API to ContributionTracking, I ended up refactori...khorn00:58, 17 August 2011

Status & tagging log