r79729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79728‎ | r79729 | r79730 >
Date:16:48, 6 January 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
insert some local variables to use with PHPs end() and reset() so as to avoid a strict standards warning
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Record.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Record.php
@@ -187,7 +187,8 @@
188188 $propname = $prop->getPropertyID();
189189 $propnum = substr( $propname, 1 );
190190 if ( ( $propname != false ) && ( is_numeric( $propnum ) ) ) {
191 - $result[( $propnum - 1 )] = reset( $this->m_data->getPropertyValues( $prop ) );
 191+ $propertyvalues = $this->m_data->getPropertyValues( $prop ); // combining this with next line violates PHP strict standards
 192+ $result[( $propnum - 1 )] = reset( $propertyvalues );
192193 }
193194 }
194195 return $result;
@@ -228,7 +229,8 @@
229230 $result .= ( $type == 4 ) ? '; ':", ";
230231 }
231232 $property = SMWPropertyValue::makeProperty( '_' . ( $i + 1 ) );
232 - $dv = reset( $this->m_data->getPropertyValues( $property ) );
 233+ $propertyvalues = $this->m_data->getPropertyValues( $property ); // combining this with next line violates PHP strict standards
 234+ $dv = reset( $propertyvalues );
233235 $result .= ( $dv !== false ) ? $this->makeValueOutputText( $type, $dv, $linker ): '?';
234236 }
235237 if ( ( $i > 1 ) && ( $type != 4 ) ) $result .= ')';

Status & tagging log