r92090 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92089‎ | r92090 | r92091 >
Date:19:51, 13 July 2011
Author:kipcool
Status:deferred (Comments)
Tags:
Comment:
removed a bug introduced by me
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Record.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/Record.php
@@ -123,11 +123,9 @@
124124 foreach ( $this->values as $key => $value ) {
125125 $rv = $comma;
126126 $repr = "$key:$value";
127 - # Duck typing (should refactor this to a has_attr() function);
128 - # ( might be replacable by property_exists() in php 5.1+ )
129 - $methods = get_class_methods( get_class( $value ) );
130 - if ( !is_null( $methods ) ) {
131 - if ( in_array( "tostring_indent", $methods ) ) {
 127+ // $value is never a class??
 128+ if ( gettype ( $value ) == "object" ) {
 129+ if ( property_exists ( $value , 'tostring_indent' ) ) {
132130 $repr = $value->tostring_indent( $depth + 1, $key );
133131 }
134132 }

Comments

#Comment by Nikerabbit (talk | contribs)   20:01, 13 July 2011

is_object()?

Status & tagging log