From 2c69095a1edf7474073451285238659d0f62ce3f Mon Sep 17 00:00:00 2001 From: Appleman1234 Date: Sun, 25 Sep 2022 13:30:13 +1000 Subject: PHP8.1 fixes from Rector --- tools/inc/lib/jsgettext/PoeditString.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'tools/inc/lib/jsgettext/PoeditString.php') diff --git a/tools/inc/lib/jsgettext/PoeditString.php b/tools/inc/lib/jsgettext/PoeditString.php index 3d59d004..5bffeea0 100644 --- a/tools/inc/lib/jsgettext/PoeditString.php +++ b/tools/inc/lib/jsgettext/PoeditString.php @@ -1,26 +1,20 @@ key = $key; - $this->value = $value; - $this->fuzzy = $fuzzy; + function __construct(public $key, public $value = '', public $fuzzy = false, $comments = []) { $this->comments = (array)$comments; } - public function __toString() { + public function __toString(): string { $str =''; foreach ($this->comments as $c) { $str .= "#: $c\n"; } if ($this->fuzzy) $str .= "#, fuzzy\n"; - $str .= 'msgid "'.str_replace('"', '\\"', $this->key).'"' . "\n"; - $str .= 'msgstr "'.str_replace('"', '\\"', $this->value).'"' . "\n"; + $str .= 'msgid "'.str_replace('"', '\\"', (string) $this->key).'"' . "\n"; + $str .= 'msgstr "'.str_replace('"', '\\"', (string) $this->value).'"' . "\n"; $str .= "\n"; return $str; } -- cgit v1.3