Fix misleading $class = false default in Html::infoBox
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Thu, 26 Mar 2015 09:43:01 +0000 (10:43 +0100)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Thu, 26 Mar 2015 09:43:01 +0000 (10:43 +0100)
I found this because my PHPStorm complains about the type mismatch.
I could have changed the @param tag to "string|bool", but when looking
at the code, the $class variable is casted to a string anyway and
never used as a bool.

Change-Id: I3450fa8a898923bbae26830ed3be0017685020d3

includes/Html.php

index c172ae0..6bd661f 100644 (file)
@@ -997,7 +997,7 @@ class Html {
         *
         * @return string
         */
-       static function infoBox( $text, $icon, $alt, $class = false ) {
+       static function infoBox( $text, $icon, $alt, $class = '' ) {
                $s = Html::openElement( 'div', array( 'class' => "mw-infobox $class" ) );
 
                $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-left' ) ) .