*/
public function __construct( $key, $params = array() ) {
$this->key = $key;
- foreach( $params as $param ){
- $this->params( $param );
- }
+ $this->parameters = array_values( $params );
}
/**
* @return Message: $this
*/
public static function key( $key ) {
- return new Message( $key );
+ return new self( $key );
}
/**
* Adds parameters to the parameter list of this message.
- * @param Vargars: parameters as Strings
+ * @param Varargs: parameters as Strings
* @return Message: $this
*/
public function params( /*...*/ ) {
- $this->parameters += array_values( func_get_args() );
+ $this->parameters = array_merge( $this->parameters, array_values( func_get_args() ) );
return $this;
}
*/
public function rawParams( /*...*/ ) {
$params = func_get_args();
- foreach( $params as $param ){
- $this->parameters[] = array( 'raw' => $param );
+ foreach( $params as $param ) {
+ $this->parameters[] = array( 'raw' => $param );
}
return $this;
}
* Request the message in any language that is supported.
* As a side effect interface message status is unconditionally
* turned off.
- * @param $lang Mixed: langauge code or language object.
+ * @param $lang Mixed: language code or Language object.
* @return Message: $this
*/
public function language( $lang ) {
* Fully parse the text from wikitext to HTML
* @return String parsed HTML
*/
- public function parse(){
+ public function parse() {
$this->format = 'parse';
- return $this->tostring();
+ return $this->toString();
}
/**
*/
public function text() {
$this->format = 'text';
- return $this->tostring();
+ return $this->toString();
}
/**
*/
public function plain() {
$this->format = 'plain';
- return $this->tostring();
+ return $this->toString();
}
/**
*/
public function parseAsBlock() {
$this->format = 'block-parse';
- return $this->tostring();
+ return $this->toString();
}
/**
*/
public function escaped() {
$this->format = 'escaped';
- return $this->tostring();
+ return $this->toString();
}
/**