X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FStatus.php;h=e5788733cf95939d22c1ba9c2016dac834aefced;hb=3c9b4b1eb13e072f2216facc424e400d3bfdde1b;hp=f8370e448879de561605de097ec4f7ac958d6be9;hpb=045ca4ca47eb3b9120599d6964b33c15bd96b6e7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Status.php b/includes/Status.php index f8370e4488..e5788733cf 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -118,6 +118,7 @@ class Status { /** * Returns the wrapped StatusValue object * @return StatusValue + * @since 1.27 */ public function getStatusValue() { return $this->sv; @@ -250,12 +251,22 @@ class Status { } /** - * Get the error list as a Message object + * Get a bullet list of the errors as a Message object. * - * @param string|string[] $shortContext A short enclosing context message name (or an array of - * message names), to be used when there is a single error. - * @param string|string[] $longContext A long enclosing context message name (or an array of - * message names), for a list. + * $shortContext and $longContext can be used to wrap the error list in some text. + * $shortContext will be preferred when there is a single error; $longContext will be + * preferred when there are multiple ones. In either case, $1 will be replaced with + * the list of errors. + * + * $shortContext is assumed to use $1 as an inline parameter: if there is a single item, + * it will not be made into a list; if there are multiple items, newlines will be inserted + * around the list. + * $longContext is assumed to use $1 as a standalone parameter; it will always receive a list. + * + * If both parameters are missing, and there is only one error, no bullet will be added. + * + * @param string|string[] $shortContext A message name or an array of message names. + * @param string|string[] $longContext A message name or an array of message names. * @param string|Language $lang Language to use for processing messages * @return Message */ @@ -286,10 +297,6 @@ class Status { $msgs = $this->getErrorMessageArray( $rawErrors, $lang ); $msgCount = count( $msgs ); - if ( $shortContext ) { - $msgCount++; - } - $s = new RawMessage( '* $' . implode( "\n* \$", range( 1, $msgCount ) ) ); $s->params( $msgs )->parse(); @@ -378,7 +385,7 @@ class Status { * * @return array A list in which each entry is an array with a message key as its first element. * The remaining array elements are the message parameters. - * @deprecated 1.25 + * @deprecated since 1.25 */ public function getErrorsArray() { return $this->getStatusArray( 'error' ); @@ -389,7 +396,7 @@ class Status { * * @return array A list in which each entry is an array with a message key as its first element. * The remaining array elements are the message parameters. - * @deprecated 1.25 + * @deprecated since 1.25 */ public function getWarningsArray() { return $this->getStatusArray( 'warning' );