From 533b9a7b56c04469be9f2ef4bd417c741f03bc9d Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Thu, 12 Apr 2012 20:19:41 +0200 Subject: [PATCH] minor cleanup Change-Id: I0c1dfde7a4b17b3f5d42f0b717cc2ccef383833a --- includes/Content.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/includes/Content.php b/includes/Content.php index aed9bba4e2..4e807165bc 100644 --- a/includes/Content.php +++ b/includes/Content.php @@ -80,7 +80,9 @@ abstract class Content { } public function isSupportedFormat( $format ) { - if ( !$format ) return true; # this means "use the default" + if ( !$format ) { + return true; // this means "use the default" + } return $this->getContentHandler()->isSupportedFormat( $format ); } @@ -100,11 +102,19 @@ abstract class Content { } public function equals( Content $that ) { - if ( empty( $that ) ) return false; - if ( $that === $this ) return true; - if ( $that->getModelName() !== $this->getModelName() ) return false; + if ( empty( $that ) ){ // FIXME: empty on an object? + return false; + } - return $this->getNativeData() == $that->getNativeData(); + if ( $that === $this ) { + return true; + } + + if ( $that->getModelName() !== $this->getModelName() ) { + return false; + } + + return $this->getNativeData() === $that->getNativeData(); } /** @@ -554,7 +564,13 @@ class MessageContent extends TextContent { $this->mParameters = $params; - if ( !$options ) $options = array(); + if ( is_null( $options ) ) { + $options = array(); + } + elseif ( is_string( $options ) ) { + $options = array( $options ); + } + $this->mOptions = $options; $this->mHtmlOptions = null; -- 2.20.1