/**
* Cached client IP address
- * @var String
+ * @var string
*/
private $ip;
* will return an empty array if it determines that the URL is
* inside a rewrite path.
*
- * @return Array: Any query arguments found in path matches.
+ * @return array Any query arguments found in path matches.
*/
public static function getPathInfo( $want = 'all' ) {
global $wgUsePathInfo;
* URL rewriting function; tries to extract page title and,
* optionally, one other fixed parameter value from a URL path.
*
- * @param string $path the URL path given from the client
- * @param array $bases one or more URLs, optionally with $1 at the end
- * @param string $key if provided, the matching key in $bases will be
- * passed on as the value of this URL parameter
- * @return array of URL variables to interpolate; empty if no match
+ * @param string $path The URL path given from the client
+ * @param array $bases One or more URLs, optionally with $1 at the end
+ * @param string $key If provided, the matching key in $bases will be
+ * passed on as the value of this URL parameter
+ * @return array Array of URL variables to interpolate; empty if no match
*/
static function extractTitle( $path, $bases, $key = false ) {
foreach ( (array)$bases as $keyValue => $base ) {
* @param bool $topLevel Specifies if the array passed is from the top
* level of the source. In PHP5 magic_quotes only escapes the first level
* of keys that belong to an array.
- * @return array the original array
+ * @return array The original array
* @see http://www.php.net/manual/en/function.get-magic-quotes-gpc.php#49612
*/
private function &fix_magic_quotes( &$arr, $topLevel = true ) {
/**
* Recursively normalizes UTF-8 strings in the given array.
*
- * @param $data string|array
- * @return array|string cleaned-up version of the given
+ * @param string|array $data
+ * @return array|string Cleaned-up version of the given
* @private
*/
function normalizeUnicode( $data ) {
/**
* Fetch a value from the given array or return $default if it's not set.
*
- * @param $arr Array
- * @param $name String
- * @param $default Mixed
+ * @param array $arr
+ * @param string $name
+ * @param mixed $default
* @return mixed
*/
private function getGPCVal( $arr, $name, $default ) {
* non-freeform text inputs (e.g. predefined internal text keys
* selected by a drop-down menu). For freeform input, see getText().
*
- * @param $name String
- * @param string $default optional default (or NULL)
- * @return String
+ * @param string $name
+ * @param string $default Optional default (or NULL)
+ * @return string
*/
public function getVal( $name, $default = null ) {
$val = $this->getGPCVal( $this->data, $name, $default );
/**
* Set an arbitrary value into our get/post data.
*
- * @param string $key key name to use
- * @param $value Mixed: value to set
- * @return Mixed: old value if one was present, null otherwise
+ * @param string $key Key name to use
+ * @param mixed $value Value to set
+ * @return mixed Old value if one was present, null otherwise
*/
public function setVal( $key, $value ) {
$ret = isset( $this->data[$key] ) ? $this->data[$key] : null;
/**
* Unset an arbitrary value from our get/post data.
*
- * @param string $key key name to use
- * @return Mixed: old value if one was present, null otherwise
+ * @param string $key Key name to use
+ * @return mixed Old value if one was present, null otherwise
*/
public function unsetVal( $key ) {
if ( !isset( $this->data[$key] ) ) {
* If source was scalar, will return an array with a single element.
* If no source and no default, returns NULL.
*
- * @param $name String
- * @param array $default optional default (or NULL)
- * @return Array
+ * @param string $name
+ * @param array $default Optional default (or NULL)
+ * @return array
*/
public function getArray( $name, $default = null ) {
$val = $this->getGPCVal( $this->data, $name, $default );
* If no source and no default, returns NULL.
* If an array is returned, contents are guaranteed to be integers.
*
- * @param $name String
+ * @param string $name
* @param array $default option default (or NULL)
- * @return Array of ints
+ * @return array Array of ints
*/
public function getIntArray( $name, $default = null ) {
$val = $this->getArray( $name, $default );
* Guaranteed to return an integer; non-numeric input will typically
* return 0.
*
- * @param $name String
- * @param $default Integer
- * @return Integer
+ * @param string $name
+ * @param int $default
+ * @return int
*/
public function getInt( $name, $default = 0 ) {
return intval( $this->getVal( $name, $default ) );
* Guaranteed to return an integer or null; non-numeric input will
* typically return null.
*
- * @param $name String
- * @return Integer
+ * @param string $name
+ * @return int|null
*/
public function getIntOrNull( $name ) {
$val = $this->getVal( $name );
* return 0.
*
* @since 1.23
- * @param $name String
- * @param $default Float
- * @return Float
+ * @param string $name
+ * @param float $default
+ * @return float
*/
public function getFloat( $name, $default = 0 ) {
return floatval( $this->getVal( $name, $default ) );
* Guaranteed to return true or false, with normal PHP semantics for
* boolean interpretation of strings.
*
- * @param $name String
- * @param $default Boolean
- * @return Boolean
+ * @param string $name
+ * @param bool $default
+ * @return bool
*/
public function getBool( $name, $default = false ) {
return (bool)$this->getVal( $name, $default );
* Unlike getBool, the string "false" will result in boolean false, which is
* useful when interpreting information sent from JavaScript.
*
- * @param $name String
- * @param $default Boolean
- * @return Boolean
+ * @param string $name
+ * @param bool $default
+ * @return bool
*/
public function getFuzzyBool( $name, $default = false ) {
return $this->getBool( $name, $default ) && strcasecmp( $this->getVal( $name ), 'false' ) !== 0;
* value is (even "0"). Return false if the named value is not set.
* Example use is checking for the presence of check boxes in forms.
*
- * @param $name String
- * @return Boolean
+ * @param string $name
+ * @return bool
*/
public function getCheck( $name ) {
# Checkboxes and buttons are only present when clicked
* user-supplied freeform text input (for which input transformations may
* be required - e.g. Esperanto x-coding).
*
- * @param $name String
- * @param string $default optional
- * @return String
+ * @param string $name
+ * @param string $default Optional
+ * @return string
*/
public function getText( $name, $default = '' ) {
global $wgContLang;
/**
* Returns the names of all input values excluding those in $exclude.
*
- * @param $exclude Array
+ * @param array $exclude
* @return array
*/
public function getValueNames( $exclude = array() ) {
* Get the values passed in the query string.
* No transformation is performed on the values.
*
- * @return Array
+ * @return array
*/
public function getQueryValues() {
return $_GET;
* Return the contents of the Query with no decoding. Use when you need to
* know exactly what was sent, e.g. for an OAuth signature over the elements.
*
- * @return String
+ * @return string
*/
public function getRawQueryString() {
return $_SERVER['QUERY_STRING'];
* Return the contents of the POST with no decoding. Use when you need to
* know exactly what was sent, e.g. for an OAuth signature over the elements.
*
- * @return String
+ * @return string
*/
public function getRawPostString() {
if ( !$this->wasPosted() ) {
* disallow reading the stream more than once. As stated in the php docs, this
* does not work with enctype="multipart/form-data".
*
- * @return String
+ * @return string
*/
public function getRawInput() {
static $input = false;
/**
* Get the HTTP method used for this request.
*
- * @return String
+ * @return string
*/
public function getMethod() {
return isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : 'GET';
* Note that values retrieved by the object may come from the
* GET URL etc even on a POST request.
*
- * @return Boolean
+ * @return bool
*/
public function wasPosted() {
return $this->getMethod() == 'POST';
* during the current request (in which case the cookie will
* be sent back to the client at the end of the script run).
*
- * @return Boolean
+ * @return bool
*/
public function checkSessionCookie() {
return isset( $_COOKIE[session_name()] );
/**
* Get a cookie from the $_COOKIE jar
*
- * @param string $key the name of the cookie
- * @param string $prefix a prefix to use for the cookie name, if not $wgCookiePrefix
- * @param $default Mixed: what to return if the value isn't found
- * @return Mixed: cookie value or $default if the cookie not set
+ * @param string $key The name of the cookie
+ * @param string $prefix A prefix to use for the cookie name, if not $wgCookiePrefix
+ * @param mixed $default What to return if the value isn't found
+ * @return mixed Cookie value or $default if the cookie not set
*/
public function getCookie( $key, $prefix = null, $default = null ) {
if ( $prefix === null ) {
* This will be suitable for use as a relative link in HTML output.
*
* @throws MWException
- * @return String
+ * @return string
*/
public function getRequestURL() {
if ( isset( $_SERVER['REQUEST_URI'] ) && strlen( $_SERVER['REQUEST_URI'] ) ) {
* If $wgServer is protocol-relative, this will return a fully
* qualified URL with the protocol that was used for this request.
*
- * @return String
+ * @return string
*/
public function getFullRequestURL() {
return wfExpandUrl( $this->getRequestURL(), PROTO_CURRENT );
* Take an arbitrary query and rewrite the present URL to include it
* @param string $query query string fragment; do not include initial '?'
*
- * @return String
+ * @return string
*/
public function appendQuery( $query ) {
return $this->appendQueryArray( wfCgiToArray( $query ) );
* HTML-safe version of appendQuery().
* @deprecated: Deprecated in 1.20, warnings in 1.21, remove in 1.22.
*
- * @param string $query query string fragment; do not include initial '?'
- * @return String
+ * @param string $query Query string fragment; do not include initial '?'
+ * @return string
*/
public function escapeAppendQuery( $query ) {
return htmlspecialchars( $this->appendQuery( $query ) );
}
/**
- * @param $key
- * @param $value
- * @param $onlyquery bool
- * @return String
+ * @param string $key
+ * @param string $value
+ * @param bool $onlyquery
+ * @return string
*/
public function appendQueryValue( $key, $value, $onlyquery = false ) {
return $this->appendQueryArray( array( $key => $value ), $onlyquery );
/**
* Appends or replaces value of query variables.
*
- * @param array $array of values to replace/add to query
- * @param bool $onlyquery whether to only return the query string and not
- * the complete URL
- * @return String
+ * @param array $array Array of values to replace/add to query
+ * @param bool $onlyquery Whether to only return the query string and not the complete URL
+ * @return string
*/
public function appendQueryArray( $array, $onlyquery = false ) {
global $wgTitle;
* defaults if not given. The limit must be positive and is capped at 5000.
* Offset must be positive but is not capped.
*
- * @param $deflimit Integer: limit to use if no input and the user hasn't set the option.
- * @param string $optionname to specify an option other than rclimit to pull from.
- * @return array first element is limit, second is offset
+ * @param int $deflimit Limit to use if no input and the user hasn't set the option.
+ * @param string $optionname To specify an option other than rclimit to pull from.
+ * @return array First element is limit, second is offset
*/
public function getLimitOffset( $deflimit = 50, $optionname = 'rclimit' ) {
global $wgUser;
/**
* Return the path to the temporary file where PHP has stored the upload.
*
- * @param $key String:
- * @return string or NULL if no such file.
+ * @param string $key
+ * @return string|null string or null if no such file.
*/
public function getFileTempname( $key ) {
$file = new WebRequestUpload( $this, $key );
/**
* Return the upload error or 0
*
- * @param $key String:
- * @return integer
+ * @param string $key
+ * @return int
*/
public function getUploadError( $key ) {
$file = new WebRequestUpload( $this, $key );
*
* Other than this the name is not verified for being a safe filename.
*
- * @param $key String:
- * @return string or NULL if no such file.
+ * @param string $key
+ * @return string|null string or null if no such file.
*/
public function getFileName( $key ) {
$file = new WebRequestUpload( $this, $key );
/**
* Return a WebRequestUpload object corresponding to the key
*
- * @param $key string
+ * @param string $key
* @return WebRequestUpload
*/
public function getUpload( $key ) {
/**
* Get an array containing all request headers
*
- * @return Array mapping header name to its value
+ * @return array Mapping header name to its value
*/
public function getAllHeaders() {
$this->initHeaders();
/**
* Get data from $_SESSION
*
- * @param string $key name of key in $_SESSION
- * @return Mixed
+ * @param string $key Name of key in $_SESSION
+ * @return mixed
*/
public function getSessionData( $key ) {
if ( !isset( $_SESSION[$key] ) ) {
/**
* Set session data
*
- * @param string $key name of key in $_SESSION
- * @param $data Mixed
+ * @param string $key Name of key in $_SESSION
+ * @param mixed $data
*/
public function setSessionData( $key, $data ) {
$_SESSION[$key] = $data;
* message or redirect to a safer URL. Returns true if the URL is OK, and
* false if an error message has been shown and the request should be aborted.
*
- * @param $extWhitelist array
+ * @param array $extWhitelist
* @throws HttpError
* @return bool
*/
* Attempt to redirect to a URL with a QUERY_STRING that's not dangerous in
* IE 6. Returns true if it was successful, false otherwise.
*
- * @param $url string
+ * @param string $url
* @return bool
*/
protected function doSecurityRedirect( $url ) {
* @since 1.19
*
* @throws MWException
- * @return String
+ * @return string
*/
protected function getRawIP() {
if ( !isset( $_SERVER['REMOTE_ADDR'] ) ) {
/**
* Constructor. Should only be called by WebRequest
*
- * @param $request WebRequest The associated request
+ * @param WebRequest $request The associated request
* @param string $key Key in $_FILES array (name of form field)
*/
public function __construct( $request, $key ) {
/**
* Return the original filename of the uploaded file
*
- * @return mixed Filename or null if non-existent
+ * @return string|null Filename or null if non-existent
*/
public function getName() {
if ( !$this->exists() ) {
/**
* Return the path to the temporary file
*
- * @return mixed Path or null if non-existent
+ * @return string|null Path or null if non-existent
*/
public function getTempName() {
if ( !$this->exists() ) {
/**
* @param array $data of *non*-urlencoded key => value pairs, the
* fake GET/POST values
- * @param bool $wasPosted whether to treat the data as POST
- * @param $session Mixed: session array or null
+ * @param bool $wasPosted Whether to treat the data as POST
+ * @param array|null $session Session array or null
* @param string $protocol 'http' or 'https'
* @throws MWException
*/
}
/**
- * @param $method string
+ * @param string $method
* @throws MWException
*/
private function notImplemented( $method ) {
}
/**
- * @param $name string
- * @param $default string
+ * @param string $name
+ * @param string $default
* @return string
*/
public function getText( $name, $default = '' ) {
}
/**
- * @return Array
+ * @return array
*/
public function getValues() {
return $this->data;
}
/**
- * @param $name string
- * @param $val string
+ * @param string $name
+ * @param string $val
*/
public function setHeader( $name, $val ) {
$name = strtoupper( $name );
}
/**
- * @param $key
- * @return mixed
+ * @param string $key
+ * @return array|null
*/
public function getSessionData( $key ) {
if ( isset( $this->session[$key] ) ) {
}
/**
- * @param $key
- * @param $data
+ * @param string $key
+ * @param array $data
*/
public function setSessionData( $key, $data ) {
$this->session[$key] = $data;
}
/**
- * @return array|Mixed|null
+ * @return array|mixed|null
*/
public function getSessionArray() {
return $this->session;
/**
* FauxRequests shouldn't depend on raw request data (but that could be implemented here)
- * @return String
+ * @return string
*/
public function getRawQueryString() {
return '';
/**
* FauxRequests shouldn't depend on raw request data (but that could be implemented here)
- * @return String
+ * @return string
*/
public function getRawPostString() {
return '';
/**
* FauxRequests shouldn't depend on raw request data (but that could be implemented here)
- * @return String
+ * @return string
*/
public function getRawInput() {
return '';
* Strings are assumed to not contain XML-illegal characters; special
* characters (<, >, &) are escaped but illegals are not touched.
*
- * @param string $element element name
+ * @param string $element Element name
* @param array $attribs Name=>value pairs. Values will be escaped.
* @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
- * @param bool $allowShortTag whether '' in $contents will result in a contentless closed tag
+ * @param bool $allowShortTag Whether '' in $contents will result in a contentless closed tag
* @return string
*/
public static function element( $element, $attribs = null, $contents = '', $allowShortTag = true ) {
* to set the XML attributes : attributename="value".
* The values are passed to Sanitizer::encodeAttribute.
* Return null if no attributes given.
- * @param array $attribs of attributes for an XML element
+ * @param array $attribs Array of attributes for an XML element
* @throws MWException
* @return null|string
*/
* $wgContLang->normalize() validator first to ensure that no invalid UTF-8
* is passed.
*
- * @param $element String:
+ * @param string $element
* @param array $attribs Name=>value pairs. Values will be escaped.
* @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
* @return string
/**
* This opens an XML element
*
- * @param string $element name of the element
- * @param array $attribs of attributes, see Xml::expandAttributes()
+ * @param string $element Name of the element
+ * @param array $attribs Array of attributes, see Xml::expandAttributes()
* @return string
*/
public static function openElement( $element, $attribs = null ) {
/**
* Shortcut to close an XML element
- * @param string $element element name
+ * @param string $element Element name
* @return string
*/
public static function closeElement( $element ) {
* Same as Xml::element(), but does not escape contents. Handy when the
* content you have is already valid xml.
*
- * @param string $element element name
- * @param array $attribs of attributes
- * @param string $contents content of the element
+ * @param string $element Element name
+ * @param array $attribs Array of attributes
+ * @param string $contents Content of the element
* @return string
*/
public static function tags( $element, $attribs = null, $contents ) {
/**
* Build a drop-down box for selecting a namespace
*
- * @param $selected Mixed: Namespace which should be pre-selected
- * @param $all Mixed: Value of an item denoting all namespaces, or null to omit
- * @param $element_name String: value of the "name" attribute of the select tag
- * @param string $label optional label to add to the field
+ * @param string $selected Namespace which should be pre-selected
+ * @param string|null $all Value of an item denoting all namespaces, or null to omit
+ * @param string $element_name Value of the "name" attribute of the select tag
+ * @param string $label Optional label to add to the field
* @return string
* @deprecated since 1.19
*/
/**
* Create a date selector
*
- * @param $selected Mixed: the month which should be selected, default ''
- * @param string $allmonths value of a special item denoting all month. Null to not include (default)
+ * @param string $selected The month which should be selected, default ''
+ * @param string $allmonths Value of a special item denoting all month. Null to not include (default)
* @param string $id Element identifier
- * @return String: Html string containing the month selector
+ * @return string Html string containing the month selector
*/
public static function monthSelector( $selected = '', $allmonths = null, $id = 'month' ) {
global $wgLang;
}
/**
- * @param $year Integer
- * @param $month Integer
+ * @param int $year
+ * @param int $month
* @return string Formatted HTML
*/
public static function dateMenu( $year, $month ) {
* Construct a language selector appropriate for use in a form or preferences
*
* @param string $selected The language code of the selected language
- * @param boolean $customisedOnly If true only languages which have some content are listed
+ * @param bool $customisedOnly If true only languages which have some content are listed
* @param string $inLanguage The ISO code of the language to display the select list in (optional)
* @param array $overrideAttrs Override the attributes of the select tag (since 1.20)
* @param Message|null $msg Label message key (since 1.20)
/**
* Shortcut to make a span element
- * @param string $text content of the element, will be escaped
- * @param string $class class name of the span element
- * @param array $attribs other attributes
+ * @param string $text Content of the element, will be escaped
+ * @param string $class Class name of the span element
+ * @param array $attribs Other attributes
* @return string
*/
public static function span( $text, $class, $attribs = array() ) {
/**
* Shortcut to make a specific element with a class attribute
- * @param string $text content of the element, will be escaped
- * @param string $class class name of the span element
- * @param string $tag element name
- * @param array $attribs other attributes
+ * @param string $text Content of the element, will be escaped
+ * @param string $class Class name of the span element
+ * @param string $tag Element name
+ * @param array $attribs Other attributes
* @return string
*/
public static function wrapClass( $text, $class, $tag = 'span', $attribs = array() ) {
/**
* Convenience function to build an HTML text input field
- * @param string $name value of the name attribute
- * @param int $size value of the size attribute
- * @param $value mixed value of the value attribute
- * @param array $attribs other attributes
+ * @param string $name Value of the name attribute
+ * @param int $size Value of the size attribute
+ * @param mixed $value Value of the value attribute
+ * @param array $attribs Other attributes
* @return string HTML
*/
public static function input( $name, $size = false, $value = false, $attribs = array() ) {
/**
* Convenience function to build an HTML password input field
- * @param string $name value of the name attribute
- * @param int $size value of the size attribute
- * @param $value mixed value of the value attribute
- * @param array $attribs other attributes
+ * @param string $name Value of the name attribute
+ * @param int $size Value of the size attribute
+ * @param mixed $value Value of the value attribute
+ * @param array $attribs Other attributes
* @return string HTML
*/
public static function password( $name, $size = false, $value = false, $attribs = array() ) {
/**
* Internal function for use in checkboxes and radio buttons and such.
*
- * @param $name string
- * @param $present bool
+ * @param string $name
+ * @param bool $present
*
* @return array
*/
/**
* Convenience function to build an HTML checkbox
- * @param string $name value of the name attribute
+ * @param string $name Value of the name attribute
* @param bool $checked Whether the checkbox is checked or not
- * @param array $attribs other attributes
+ * @param array $attribs Array other attributes
* @return string HTML
*/
public static function check( $name, $checked = false, $attribs = array() ) {
/**
* Convenience function to build an HTML radio button
- * @param string $name value of the name attribute
- * @param string $value value of the value attribute
+ * @param string $name Value of the name attribute
+ * @param string $value Value of the value attribute
* @param bool $checked Whether the checkbox is checked or not
- * @param array $attribs other attributes
+ * @param array $attribs Other attributes
* @return string HTML
*/
public static function radio( $name, $value, $checked = false, $attribs = array() ) {
/**
* Convenience function to build an HTML form label
- * @param string $label text of the label
- * @param $id
- * @param array $attribs an attribute array. This will usually be
+ * @param string $label Text of the label
+ * @param string $id
+ * @param array $attribs An attribute array. This will usually be
* the same array as is passed to the corresponding input element,
* so this function will cherry-pick appropriate attributes to
* apply to the label as well; only class and title are applied.
/**
* Convenience function to build an HTML text input field with a label
- * @param string $label text of the label
- * @param string $name value of the name attribute
- * @param string $id id of the input
- * @param int|Bool $size value of the size attribute
- * @param string|Bool $value value of the value attribute
- * @param array $attribs other attributes
+ * @param string $label Text of the label
+ * @param string $name Value of the name attribute
+ * @param string $id Id of the input
+ * @param int|bool $size Value of the size attribute
+ * @param string|bool $value Value of the value attribute
+ * @param array $attribs Other attributes
* @return string HTML
*/
public static function inputLabel( $label, $name, $id, $size = false, $value = false, $attribs = array() ) {
/**
* Same as Xml::inputLabel() but return input and label in an array
*
- * @param $label String
- * @param $name String
- * @param $id String
- * @param $size Int|Bool
- * @param $value String|Bool
- * @param $attribs array
+ * @param string $label
+ * @param string $name
+ * @param string $id
+ * @param int|bool $size
+ * @param string|bool $value
+ * @param array $attribs
*
* @return array
*/
/**
* Convenience function to build an HTML checkbox with a label
*
- * @param $label
- * @param $name
- * @param $id
- * @param $checked bool
- * @param $attribs array
+ * @param string $label
+ * @param string $name
+ * @param string $id
+ * @param bool $checked
+ * @param array $attribs
*
* @return string HTML
*/
/**
* Convenience function to build an HTML radio button with a label
*
- * @param $label
- * @param $name
- * @param $value
- * @param $id
- * @param $checked bool
- * @param $attribs array
+ * @param string $label
+ * @param string $name
+ * @param string $value
+ * @param string $id
+ * @param bool $checked
+ * @param array $attribs
*
* @return string HTML
*/
/**
* Convenience function to build an HTML submit button
- * @param string $value label text for the button
- * @param array $attribs optional custom attributes
+ * @param string $value Label text for the button
+ * @param array $attribs Optional custom attributes
* @return string HTML
*/
public static function submitButton( $value, $attribs = array() ) {
/**
* Convenience function to build an HTML drop-down list item.
- * @param string $text text for this item. Will be HTML escaped
- * @param string $value form submission value; if empty, use text
- * @param $selected boolean: if true, will be the default selected item
- * @param array $attribs optional additional HTML attributes
+ * @param string $text Text for this item. Will be HTML escaped
+ * @param string $value Form submission value; if empty, use text
+ * @param bool $selected If true, will be the default selected item
+ * @param array $attribs Optional additional HTML attributes
* @return string HTML
*/
public static function option( $text, $value = null, $selected = false,
/**
* Build a drop-down box from a textual list.
*
- * @param $name Mixed: Name and id for the drop-down
- * @param $list Mixed: Correctly formatted text (newline delimited) to be used to generate the options
- * @param $other Mixed: Text for the "Other reasons" option
- * @param $selected Mixed: Option which should be pre-selected
- * @param $class Mixed: CSS classes for the drop-down
- * @param $tabindex Mixed: Value of the tabindex attribute
+ * @param string $name Name and id for the drop-down
+ * @param string $list Correctly formatted text (newline delimited) to be used to generate the options
+ * @param string $other Text for the "Other reasons" option
+ * @param string $selected Option which should be pre-selected
+ * @param string $class CSS classes for the drop-down
+ * @param int $tabindex Value of the tabindex attribute
* @return string
*/
public static function listDropDown( $name = '', $list = '', $other = '', $selected = '', $class = '', $tabindex = null ) {
* Illegal control characters are assumed not to be present.
*
* @deprecated since 1.21; use Xml::encodeJsVar() or Xml::encodeJsCall() instead
- * @param string $string to escape
- * @return String
+ * @param string $string String to escape
+ * @return string
*/
public static function escapeJsString( $string ) {
// See ECMA 262 section 7.8.4 for string literal format
*
* @param mixed $value The value being encoded. Can be any type except a resource.
* @param bool $pretty If true, add non-significant whitespace to improve readability.
- * @return string|bool: String if successful; false upon failure
+ * @return string|bool String if successful; false upon failure
*/
public static function encodeJsVar( $value, $pretty = false ) {
if ( $value instanceof XmlJsCode ) {
* which evaluates to a function object which is called.
* @param array $args The arguments to pass to the function.
* @param bool $pretty If true, add non-significant whitespace to improve readability.
- * @return string|bool: String if successful; false upon failure
+ * @return string|bool String if successful; false upon failure
*/
public static function encodeJsCall( $name, $args, $pretty = false ) {
foreach ( $args as &$arg ) {
* Check if a string is well-formed XML.
* Must include the surrounding tag.
*
- * @param string $text string to test.
+ * @param string $text String to test.
* @return bool
*
* @todo Error position reporting return
* Wraps fragment in an \<html\> bit and doctype, so it can be a fragment
* and can use HTML named entities.
*
- * @param $text String:
+ * @param string $text
* @return bool
*/
public static function isWellFormedXmlFragment( $text ) {
* Replace " > and < with their respective HTML entities ( ",
* >, <)
*
- * @param string $in text that might contain HTML tags.
+ * @param string $in Text that might contain HTML tags.
* @return string Escaped string
*/
public static function escapeTagsOnly( $in ) {
}
/**
- * @param $default
+ * @param string $default
*/
public function setDefault( $default ) {
$this->default = $default;
}
/**
- * @param $name string
- * @param $value
+ * @param string $name
+ * @param array $value
*/
public function setAttribute( $name, $value ) {
$this->attributes[$name] = $value;
}
/**
- * @param $name
+ * @param string $name
* @return array|null
*/
public function getAttribute( $name ) {
}
/**
- * @param $name
- * @param $value bool
+ * @param string $name
+ * @param bool $value
*/
public function addOption( $name, $value = false ) {
// Stab stab stab
* label => value
* label => ( label => value, label => value )
*
- * @param $options
+ * @param array $options
*/
public function addOptions( $options ) {
$this->options[] = $options;
* label => value
* label => ( label => value, label => value )
*
- * @param $options
+ * @param array $options
* @param bool $default
* @return string
*/