* Manage forms to be shown according to posted data.
* Depending on the submit button used, call a form or a save function.
*
- * @param mixed $par String if any subpage provided, else null
+ * @param $par Mixed: string if any subpage provided, else null
*/
function execute( $par ) {
// If the visitor doesn't have permissions to assign or remove
* Save user groups changes in the database.
* Data comes from the editUserGroupsForm() form function
*
- * @param string $username Username to apply changes to.
- * @param string $reason Reason for group change
+ * @param $username String: username to apply changes to.
+ * @param $reason String: reason for group change
* @return null
*/
function saveUserGroups( $username, $reason = '') {
/**
* Edit user groups membership
- * @param string $username Name of the user.
+ * @param $username String: name of the user.
*/
function editUserGroupsForm( $username ) {
global $wgOut;
/**
* Format a link to a group description page
*
- * @param string $group
+ * @param $group string
* @return string
*/
private static function buildGroupLink( $group ) {
}
/**
- * Adds the <select> thingie where you can select what groups to add/remove
+ * Adds a table with checkboxes where you can select what groups to add/remove
*
- * @param array $groups The groups that can be added/removed
- * @param string $name 'removable' or 'available'
- * @return string XHTML <select> element
+ * @param $usergroups Array: groups the user belongs to
+ * @return string XHTML table element with checkboxes
*/
private function groupCheckboxes( $usergroups ) {
$allgroups = $this->getAllGroups();
}
/**
- * @param string $group The name of the group to check
+ * @param $group String: the name of the group to check
* @return bool Can we remove the group?
*/
private function canRemove( $group ) {
}
/**
- * @param string $group The name of the group to check
+ * @param $group string: the name of the group to check
* @return bool Can we add the group?
*/
private function canAdd( $group ) {
/**
* Returns an array of the groups that a particular group can add/remove.
*
- * @param String $group The group to check for whether it can add/remove
+ * @param $group String: the group to check for whether it can add/remove
* @return Array array( 'add' => array( addablegroups ), 'remove' => array( removablegroups ) )
*/
private function changeableByGroup( $group ) {
/**
* Show a rights log fragment for the specified user
*
- * @param User $user User to show log for
- * @param OutputPage $output OutputPage to use
+ * @param $user User to show log for
+ * @param $output OutputPage to use
*/
protected function showLogFragment( $user, $output ) {
$output->addHtml( Xml::element( 'h2', null, LogPage::logName( 'rights' ) . "\n" ) );
/**
* Format an individual result
*
- * @param Skin $skin Skin to use for UI elements
- * @param object $result Result row
+ * @param $skin Skin to use for UI elements
+ * @param $result Result row
* @return string
*/
public function formatResult( $skin, $result ) {
/**
* Make a "what links here" link for a specified result if required
*
- * @param Title $title Title to make the link for
- * @param Skin $skin Skin to use
- * @param object $result Result row
+ * @param $title Title to make the link for
+ * @param $skin Skin to use
+ * @param $result Result row
* @return string
*/
private function makeWlhLink( $title, $skin, $result ) {
}
/**
- * @param int $level Recursion level
- * @param Title $target Target title
- * @param int $limit Number of entries to display
- * @param Title $from Display from this article ID
- * @param Title $back Display from this article ID at backwards scrolling
+ * @param $level int Recursion level
+ * @param $target Title Target title
+ * @param $limit int Number of entries to display
+ * @param $from Title Display from this article ID
+ * @param $back Title Display from this article ID at backwards scrolling
* @private
*/
function showIndirectLinks( $level, $target, $limit, $from = 0, $back = 0 ) {
/**
* Open a database connection to work on for the requested user.
* This may be a new connection to another database for remote users.
- * @param string $database
+ * @param $database string
* @return Database or null if invalid selection
*/
public static function getDB( $database ) {
* Internal 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
+ * @param $path string: the URL path given from the client
+ * @param $bases array: one or more URLs, optionally with $1 at the end
+ * @param $key string: 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
*/
private function extractTitle( $path, $bases, $key=false ) {
/**
* Recursively strips slashes from the given array;
* used for undoing the evil that is magic_quotes_gpc.
- * @param array &$arr will be modified
+ * @param $arr array: will be modified
* @return array the original array
* @private
*/
/**
* Recursively normalizes UTF-8 strings in the given array.
- * @param array $data string or array
+ * @param $data string or array
* @return cleaned-up version of the given
* @private
*/
/**
* Fetch a value from the given array or return $default if it's not set.
*
- * @param array $arr
- * @param string $name
- * @param mixed $default
+ * @param $arr array
+ * @param $name string
+ * @param $default mixed
* @return mixed
* @private
*/
* non-freeform text inputs (e.g. predefined internal text keys
* selected by a drop-down menu). For freeform input, see getText().
*
- * @param string $name
- * @param string $default optional default (or NULL)
+ * @param $name string
+ * @param $default string: optional default (or NULL)
* @return string
*/
function getVal( $name, $default = NULL ) {
* If source was scalar, will return an array with a single element.
* If no source and no default, returns NULL.
*
- * @param string $name
- * @param array $default optional default (or NULL)
+ * @param $name string
+ * @param $default array: optional default (or NULL)
* @return array
*/
function getArray( $name, $default = NULL ) {
* If no source and no default, returns NULL.
* If an array is returned, contents are guaranteed to be integers.
*
- * @param string $name
- * @param array $default option default (or NULL)
+ * @param $name string
+ * @param $default array: option default (or NULL)
* @return array of ints
*/
function getIntArray( $name, $default = NULL ) {
* Fetch an integer value from the input or return $default if not set.
* Guaranteed to return an integer; non-numeric input will typically
* return 0.
- * @param string $name
- * @param int $default
+ * @param $name string
+ * @param $default int
* @return int
*/
function getInt( $name, $default = 0 ) {
* Fetch an integer value from the input or return null if empty.
* Guaranteed to return an integer or null; non-numeric input will
* typically return null.
- * @param string $name
+ * @param $name string
* @return int
*/
function getIntOrNull( $name ) {
* Fetch a boolean value from the input or return $default if not set.
* Guaranteed to return true or false, with normal PHP semantics for
* boolean interpretation of strings.
- * @param string $name
- * @param bool $default
+ * @param $name string
+ * @param $default bool
* @return bool
*/
function getBool( $name, $default = false ) {
* Return true if the named value is set in the input, whatever that
* 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 string $name
+ * @param $name string
* @return bool
*/
function getCheck( $name ) {
* input (for which input transformations may be required - e.g. Esperanto
* x-coding).
*
- * @param string $name
- * @param string $default optional
+ * @param $name string
+ * @param $default string: optional
* @return string
*/
function getText( $name, $default = '' ) {
/**
* Appends or replaces value of query variables.
* @param $array Array of values to replace/add to query
+ * @param $onlyquery Bool: whether to only return the query string and not
+ * the complete URL
* @return string
*/
function appendQueryArray( $array, $onlyquery = false ) {
/**
* Get a request header, or false if it isn't set
- * @param string $name Case-insensitive header name
+ * @param $name String: case-insensitive header name
*/
function getHeader( $name ) {
$name = strtoupper( $name );
var $wasPosted = false;
/**
- * @param array $data Array of *non*-urlencoded key => value pairs, the
+ * @param $data Array of *non*-urlencoded key => value pairs, the
* fake GET/POST values
- * @param bool $wasPosted Whether to treat the data as POST
+ * @param $wasPosted Bool: whether to treat the data as POST
*/
function FauxRequest( $data, $wasPosted = false ) {
if( is_array( $data ) ) {
/**
* Check if connection to zhdaemon is successful
- *
- * @access public
*/
function isconnected() {
return $this->mConnected;
/**
* Convert the input to a different language variant
*
- * @param string $text input text
- * @param string $tolang language variant
+ * @param $text string: input text
+ * @param $tolang string: language variant
* @return string the converted text
- * @access public
*/
function convert($text, $tolang) {
$len = strlen($text);
/**
* Convert the input to all possible variants
*
- * @param string $text input text
+ * @param $text string: input text
* @return array langcode => converted_string
- * @access public
*/
function convertToAllVariants($text) {
$len = strlen($text);
/**
* Perform word segmentation
*
- * @param string $text input text
+ * @param $text string: input text
* @return string segmented text
- * @access public
*/
function segment($text) {
$len = strlen($text);
/**
* Close the connection
- *
- * @access public
*/
function close() {
fclose($this->mFP);
* Fast return for pure ASCII strings; some lesser optimizations for
* strings containing only known-good characters. Not as fast as toNFC().
*
- * @param string $string a UTF-8 string
+ * @param $string String: a UTF-8 string
* @return string a clean, shiny, normalized UTF-8 string
- * @static
*/
static function cleanUp( $string ) {
if( NORMALIZE_ICU ) {
* Fast return for pure ASCII strings; some lesser optimizations for
* strings containing only known-good characters.
*
- * @param string $string a valid UTF-8 string. Input is not validated.
+ * @param $string String: a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form C
- * @static
*/
static function toNFC( $string ) {
if( NORMALIZE_ICU )
* Convert a UTF-8 string to normal form D, canonical decomposition.
* Fast return for pure ASCII strings.
*
- * @param string $string a valid UTF-8 string. Input is not validated.
+ * @param $string String: a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form D
- * @static
*/
static function toNFD( $string ) {
if( NORMALIZE_ICU )
* This may cause irreversible information loss, use judiciously.
* Fast return for pure ASCII strings.
*
- * @param string $string a valid UTF-8 string. Input is not validated.
+ * @param $string String: a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form KC
- * @static
*/
static function toNFKC( $string ) {
if( NORMALIZE_ICU )
* This may cause irreversible information loss, use judiciously.
* Fast return for pure ASCII strings.
*
- * @param string $string a valid UTF-8 string. Input is not validated.
+ * @param $string String: a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form KD
- * @static
*/
static function toNFKD( $string ) {
if( NORMALIZE_ICU )
/**
* Load the basic composition data if necessary
* @private
- * @static
*/
static function loadData() {
global $utfCombiningClass;
/**
* Returns true if the string is _definitely_ in NFC.
* Returns false if not or uncertain.
- * @param string $string a valid UTF-8 string. Input is not validated.
+ * @param $string String: a valid UTF-8 string. Input is not validated.
* @return bool
- * @static
*/
static function quickIsNFC( $string ) {
# ASCII is always valid NFC!
/**
* Returns true if the string is _definitely_ in NFC.
* Returns false if not or uncertain.
- * @param string $string a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
- * @static
+ * @param $string String: a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
*/
static function quickIsNFCVerify( &$string ) {
# Screen out some characters that eg won't be allowed in XML
# checking for validity or any optimization etc. Input must be
# VALID UTF-8!
/**
- * @param string $string
+ * @param $string string
* @return string
* @private
- * @static
*/
static function NFC( $string ) {
return UtfNormal::fastCompose( UtfNormal::NFD( $string ) );
}
/**
- * @param string $string
+ * @param $string string
* @return string
* @private
- * @static
*/
static function NFD( $string ) {
UtfNormal::loadData();
}
/**
- * @param string $string
+ * @param $string string
* @return string
* @private
- * @static
*/
static function NFKC( $string ) {
return UtfNormal::fastCompose( UtfNormal::NFKD( $string ) );
}
/**
- * @param string $string
+ * @param $string string
* @return string
* @private
- * @static
*/
static function NFKD( $string ) {
global $utfCompatibilityDecomp;
* (depending on which decomposition map is passed to us).
* Input is assumed to be *valid* UTF-8. Invalid code will break.
* @private
- * @param string $string Valid UTF-8 string
- * @param array $map hash of expanded decomposition map
+ * @param $string String: valid UTF-8 string
+ * @param $map Array: hash of expanded decomposition map
* @return string a UTF-8 string decomposed, not yet normalized (needs sorting)
- * @static
*/
static function fastDecompose( $string, $map ) {
UtfNormal::loadData();
* Sorts combining characters into canonical order. This is the
* final step in creating decomposed normal forms D and KD.
* @private
- * @param string $string a valid, decomposed UTF-8 string. Input is not validated.
+ * @param $string String: a valid, decomposed UTF-8 string. Input is not validated.
* @return string a UTF-8 string with combining characters sorted in canonical order
- * @static
*/
static function fastCombiningSort( $string ) {
UtfNormal::loadData();
* Produces canonically composed sequences, i.e. normal form C or KC.
*
* @private
- * @param string $string a valid UTF-8 string in sorted normal form D or KD. Input is not validated.
+ * @param $string String: a valid UTF-8 string in sorted normal form D or KD. Input is not validated.
* @return string a UTF-8 string with canonical precomposed characters used where possible
- * @static
*/
static function fastCompose( $string ) {
UtfNormal::loadData();
/**
* This is just used for the benchmark, comparing how long it takes to
* interate through a string without really doing anything of substance.
- * @param string $string
+ * @param $string string
* @return string
- * @static
*/
static function placebo( $string ) {
$len = strlen( $string );