MediaWiki  1.34.0
ScalarParam.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Wikimedia\Message;
4 
10 class ScalarParam extends MessageParam {
17  public function __construct( $type, $value ) {
18  $this->type = $type;
19  $this->value = $value;
20  }
21 
22  public function dump() {
23  if ( $this->value instanceof MessageValue ) {
24  $contents = $this->value->dump();
25  } else {
26  $contents = htmlspecialchars( $this->value );
27  }
28  return "<{$this->type}>" . $contents . "</{$this->type}>";
29  }
30 }
Wikimedia\Message\ScalarParam\__construct
__construct( $type, $value)
Construct a text parameter.
Definition: ScalarParam.php:17
Wikimedia\Message\MessageParam\$type
$type
Definition: MessageParam.php:11
value
if( $inline) $status value
Definition: SyntaxHighlight.php:346
Wikimedia\Message\ScalarParam
Value object representing a message parameter holding a single value.
Definition: ScalarParam.php:10
Wikimedia\Message\MessageValue
Value object representing a message for i18n.
Definition: MessageValue.php:14
Wikimedia\Message
Definition: IMessageFormatterFactory.php:3
Wikimedia\Message\ScalarParam\dump
dump()
Dump the object for testing/debugging.
Definition: ScalarParam.php:22
Wikimedia\Message\MessageParam\$value
$value
Definition: MessageParam.php:12
Wikimedia\Message\MessageParam
Value object representing a message parameter that consists of a list of values.
Definition: MessageParam.php:10