- Small fix for a bug found within PHP 8
This commit is contained in:
parent
84e3b91199
commit
af4be4ed7f
@ -31,8 +31,6 @@ class I18n implements MissingKeyInterface
|
|||||||
$this->dataReader = $dataReader;
|
$this->dataReader = $dataReader;
|
||||||
$this->cacheReader = $cacheReader;
|
$this->cacheReader = $cacheReader;
|
||||||
$this->missingKey = $missingKey;
|
$this->missingKey = $missingKey;
|
||||||
|
|
||||||
$this->locale = \Locale::getDefault() ?: $this->locale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initialize(bool $useCache) : bool
|
public function initialize(bool $useCache) : bool
|
||||||
@ -136,7 +134,8 @@ class I18n implements MissingKeyInterface
|
|||||||
$search = [];
|
$search = [];
|
||||||
|
|
||||||
foreach($matches as $item) {
|
foreach($matches as $item) {
|
||||||
$search[ $item[0] ] = Iterate::arrayGet($parameters, $item[1]);
|
$iterate = Iterate::arrayGet($parameters, $item[1]);
|
||||||
|
$search[ $item[0] ] = $iterate !== null ? $iterate : $item[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return str_replace(array_keys($search), array_values($search), $string);
|
return str_replace(array_keys($search), array_values($search), $string);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user