Commit b43d1290 authored by larowlan's avatar larowlan

Issue #2791907 by ddrozdik, Chi: Improve TranslatableMarkup and FormattableMarkup classes

parent 05b9f0a9
......@@ -61,6 +61,13 @@
*/
class FormattableMarkup implements MarkupInterface, \Countable {
/**
* The string containing placeholders.
*
* @var string
*/
protected $string;
/**
* The arguments to replace placeholders with.
*
......
......@@ -23,13 +23,6 @@ class TranslatableMarkup extends FormattableMarkup {
use ToStringTrait;
/**
* The string to be translated.
*
* @var string
*/
protected $string;
/**
* The translated markup without placeholder replacements.
*
......@@ -139,8 +132,7 @@ public function __construct($string, array $arguments = [], array $options = [],
$message = $string instanceof TranslatableMarkup ? '$string ("' . $string->getUntranslatedString() . '") must be a string.' : '$string ("' . (string) $string . '") must be a string.';
throw new \InvalidArgumentException($message);
}
$this->string = $string;
$this->arguments = $arguments;
parent::__construct($string, $arguments);
$this->options = $options;
$this->stringTranslation = $string_translation;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment