Type hinting
authorHappy-melon <happy-melon@users.mediawiki.org>
Mon, 17 Oct 2011 15:56:25 +0000 (15:56 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Mon, 17 Oct 2011 15:56:25 +0000 (15:56 +0000)
includes/HTMLForm.php
includes/Xml.php

index c30a77b..5a46ee6 100644 (file)
@@ -81,7 +81,10 @@ class HTMLForm {
        );
 
        protected $mMessagePrefix;
+
+       /** @var HTMLFormField[] */
        protected $mFlatFields;
+
        protected $mFieldTree;
        protected $mShowReset = false;
        public $mFieldData;
@@ -512,6 +515,7 @@ class HTMLForm {
 
        /**
         * Get the whole body of the form.
+        * @return String
         */
        function getBody() {
                return $this->displaySection( $this->mFieldTree );
@@ -686,9 +690,10 @@ class HTMLForm {
 
        /**
         * TODO: Document
-        * @param $fields array of fields (either arrays or objects)
+        * @param $fields array[]|HTMLFormField[] array of fields (either arrays or objects)
         * @param $sectionName string ID attribute of the <table> tag for this section, ignored if empty
         * @param $fieldsetIDPrefix string ID prefix for the <fieldset> tag of each subsection, ignored if empty
+        * @return String
         */
        function displaySection( $fields, $sectionName = '', $fieldsetIDPrefix = '' ) {
                $tableHtml = '';
@@ -1310,6 +1315,7 @@ class HTMLCheckField extends HTMLFormField {
        /**
         * For a checkbox, the label goes on the right hand side, and is
         * added in getInputHTML(), rather than HTMLFormField::getRow()
+        * @return String
         */
        function getLabel() {
                return '&#160;';
@@ -1756,6 +1762,8 @@ class HTMLRadioField extends HTMLFormField {
        /**
         * This returns a block of all the radio options, in one cell.
         * @see includes/HTMLFormField#getInputHTML()
+        * @param $value String
+        * @return String
         */
        function getInputHTML( $value ) {
                $html = $this->formatOptions( $this->mParams['options'], $value );
@@ -1881,6 +1889,9 @@ class HTMLSubmitField extends HTMLFormField {
 
        /**
         * Button cannot be invalid
+        * @param $value String
+        * @param $alldata Array
+        * @return Bool
         */
        public function validate( $value, $alldata ){
                return true;
index c5150ad..a0722f7 100644 (file)
@@ -334,10 +334,10 @@ class Xml {
 
        /**
         * Convenience function to build an HTML radio button
-        * @param $name value of the name attribute
-        * @param $value value of the value attribute
-        * @param $checked Whether the checkbox is checked or not
-        * @param $attribs other attributes
+        * @param $name String value of the name attribute
+        * @param $value String value of the value attribute
+        * @param $checked Bool Whether the checkbox is checked or not
+        * @param $attribs Array other attributes
         * @return string HTML
         */
        public static function radio( $name, $value, $checked = false, $attribs = array() ) {
@@ -376,8 +376,8 @@ class Xml {
         * @param $label String text of the label
         * @param $name String value of the name attribute
         * @param $id String id of the input
-        * @param $size int value of the size attribute
-        * @param $value value of the value attribute
+        * @param $size Int|Bool value of the size attribute
+        * @param $value String|Bool value of the value attribute
         * @param $attribs array other attributes
         * @return string HTML
         */
@@ -389,11 +389,11 @@ class Xml {
        /**
         * Same as Xml::inputLabel() but return input and label in an array
         *
-        * @param $label
-        * @param $name
-        * @param $id
-        * @param $size
-        * @param $value
+        * @param $label String
+        * @param $name String
+        * @param $id String
+        * @param $size Int|Bool
+        * @param $value String|Bool
         * @param $attribs array
         *
         * @return array