r96820 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96819‎ | r96820 | r96821 >
Date:00:08, 12 September 2011
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
Follow up to r96819;
Modified paths:
  • /trunk/extensions/Survey/specials/SpecialSurvey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/specials/SpecialSurvey.php
@@ -233,6 +233,8 @@
234234
235235 $nrs = array_merge( array( 0.01, 0.1 ), range( 1, 100 ) );
236236
 237+ $lang = $this->getLang();
 238+
237239 $fields[] = array(
238240 'type' => 'select',
239241 'default' => $survey->getField( 'ratio' ),
@@ -240,7 +242,7 @@
241243 'id' => 'survey-ratio',
242244 'name' => 'survey-ratio',
243245 'options' => array_flip( array_map(
244 - function( $n ) { return $this->getLang()->formatNum( $n ); },
 246+ function( $n ) use( $lang ) { return $lang->formatNum( $n ); },
245247 array_combine( $nrs, $nrs )
246248 ) ),
247249 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96819Follow up to r96818;jeroendedauw23:57, 11 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   09:00, 12 September 2011

Is that PHP 5.3 syntax?

#Comment by Jeroen De Dauw (talk | contribs)   13:46, 12 September 2011

Yeah. I think it's rather silly compared to JS or Python, but at least it's less ridiculous then not having anon functions at all.

Status & tagging log