Merge "Removed useless keys() function from BagOStuff."
[lhc/web/wiklou.git] / includes / FormOptions.php
index 33bbd86..598be05 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Helper class to keep track of options when mixing links and form elements.
  *
- * Copyright © 2008, Niklas Laxstiröm
+ * Copyright © 2008, Niklas Laxström
  * Copyright © 2011, Antoine Musso
  *
  * This program is free software; you can redistribute it and/or modify
@@ -22,7 +22,7 @@
  *
  * @file
  * @author Niklas Laxström
- * @author Antoine Musso 
+ * @author Antoine Musso
  */
 
 /**
@@ -83,6 +83,7 @@ class FormOptions implements ArrayAccess {
         * which will be assumed as INT if the data is an integer.
         *
         * @param $data Mixed: value to guess type for
+        * @throws MWException
         * @exception MWException Unsupported datatype
         * @return int Type constant
         */
@@ -105,6 +106,7 @@ class FormOptions implements ArrayAccess {
         *
         * @param $name String: option name
         * @param $strict Boolean: throw an exception when the option does not exist (default false)
+        * @throws MWException
         * @return Boolean: true if option exist, false otherwise
         */
        public function validateName( $name, $strict = false ) {
@@ -176,8 +178,9 @@ class FormOptions implements ArrayAccess {
 
        /**
         * @todo Document
-        * @param $name String: option name
-        * @return null
+        * @param string $name Option name
+        * @throws MWException If option does not exist.
+        * @return mixed Value or the default value if it is null.
         */
        public function consumeValue( $name ) {
                $this->validateName( $name, true );
@@ -205,11 +208,12 @@ class FormOptions implements ArrayAccess {
 
        /**
         * Validate and set an option integer value
-        * The value will be altered to fit in the range. 
+        * The value will be altered to fit in the range.
         *
         * @param $name String: option name
         * @param $min Int: minimum value
         * @param $max Int: maximum value
+        * @throws MWException
         * @exception MWException Option is not of type int
         * @return null
         */