r112257 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112256‎ | r112257 | r112258 >
Date:22:58, 23 February 2012
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
fix doc, this is not an array
Modified paths:
  • /trunk/phase3/includes/Pager.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Pager.php
@@ -925,22 +925,27 @@
926926
927927 /**
928928 * @protected
929 - * @param $row Array
 929+ * @param stdClass $row
930930 * @return String HTML
931931 */
932932 function formatRow( $row ) {
933 - $this->mCurrentRow = $row; # In case formatValue etc need to know
 933+ $this->mCurrentRow = $row; // In case formatValue etc need to know
934934 $s = Xml::openElement( 'tr', $this->getRowAttrs( $row ) );
935935 $fieldNames = $this->getFieldNames();
 936+
936937 foreach ( $fieldNames as $field => $name ) {
937938 $value = isset( $row->$field ) ? $row->$field : null;
938939 $formatted = strval( $this->formatValue( $field, $value ) );
 940+
939941 if ( $formatted == '' ) {
940942 $formatted = ' ';
941943 }
 944+
942945 $s .= Xml::tags( 'td', $this->getCellAttrs( $field, $value ), $formatted );
943946 }
 947+
944948 $s .= "</tr>\n";
 949+
945950 return $s;
946951 }
947952

Comments

#Comment by Aaron Schulz (talk | contribs)   18:53, 24 February 2012

MySQL uses stdclass, do the others? I've seen such objects documented as "Row" or "object".

#Comment by Jeroen De Dauw (talk | contribs)   18:59, 24 February 2012

I'm not sure and am fine with documenting it as object. Row could also be interpreted as an array, which it is not, so I'd avoid that one.

Status & tagging log