aboutsummaryrefslogtreecommitdiff
path: root/cli/i18n/I18nValue.php
diff options
context:
space:
mode:
Diffstat (limited to 'cli/i18n/I18nValue.php')
-rw-r--r--cli/i18n/I18nValue.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/i18n/I18nValue.php b/cli/i18n/I18nValue.php
index 4a1ddaeee..22317e1ae 100644
--- a/cli/i18n/I18nValue.php
+++ b/cli/i18n/I18nValue.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class I18nValue {
private const STATE_DIRTY = 'dirty';
@@ -13,7 +14,11 @@ class I18nValue {
private string $value;
private ?string $state = null;
- public function __construct(string $data) {
+ /** @param I18nValue|string $data */
+ public function __construct($data) {
+ if ($data instanceof I18nValue) {
+ $data = $data->__toString();
+ }
$data = explode(' -> ', $data);
$this->value = array_shift($data);