Merge "Clarify comment on SpecialPage::getDescription"
[lhc/web/wiklou.git] / includes / htmlform / HTMLSelectField.php
index 60e680b..d2dd432 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * A select dropdown field.  Basically a wrapper for Xmlselect class
  */
@@ -10,7 +11,7 @@ class HTMLSelectField extends HTMLFormField {
                        return $p;
                }
 
-               $validOptions = HTMLFormField::flattenOptions( $this->mParams[ 'options' ] );
+               $validOptions = HTMLFormField::flattenOptions( $this->mParams['options'] );
 
                if ( in_array( $value, $validOptions ) ) {
                        return true;
@@ -25,14 +26,14 @@ class HTMLSelectField extends HTMLFormField {
                # If one of the options' 'name' is int(0), it is automatically selected.
                # because PHP sucks and thinks int(0) == 'some string'.
                # Working around this by forcing all of them to strings.
-               foreach ( $this->mParams[ 'options' ] as &$opt ) {
+               foreach ( $this->mParams['options'] as &$opt ) {
                        if ( is_int( $opt ) ) {
                                $opt = strval( $opt );
                        }
                }
                unset( $opt ); # PHP keeps $opt around as a reference, which is a bit scary
 
-               if ( ! empty( $this->mParams[ 'disabled' ] ) ) {
+               if ( !empty( $this->mParams['disabled'] ) ) {
                        $select->setAttribute( 'disabled', 'disabled' );
                }
 
@@ -40,8 +41,8 @@ class HTMLSelectField extends HTMLFormField {
                        $select->setAttribute( 'class', $this->mClass );
                }
 
-               $select->addOptions( $this->mParams[ 'options' ] );
+               $select->addOptions( $this->mParams['options'] );
 
                return $select->getHTML();
        }
-}
\ No newline at end of file
+}