Skip to content

Commit

Permalink
Fix #19924: Fix yii\i18n\Formatter to not throw error `Unknown name…
Browse files Browse the repository at this point in the history
…d parameter` under PHP 8
  • Loading branch information
arollmann authored Aug 21, 2023
1 parent e916e9d commit 4c0a00f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Yii Framework 2 Change Log
- Enh #19884: Added support Enums in Query Builder (sk1t0n)
- Bug #19908: Fix associative array cell content rendering in Table widget (rhertogh)
- Bug #19906: Fixed multiline strings in the `\yii\console\widgets\Table` widget (rhertogh)
- Bug #19924: Fix `yii\i18n\Formatter` to not throw error `Unknown named parameter` under PHP 8 (arollmann)
- Bug #19914: Fixed `ArrayHelper::keyExists()` and `::remove()` functions when the key is a float and the value is `null` (rhertogh)
- Enh #19920: Broadened the accepted type of `Cookie::$expire` from `int` to `int|string|\DateTimeInterface|null` (rhertogh)

Expand Down
2 changes: 1 addition & 1 deletion framework/i18n/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public function format($value, $format)
}
$method = 'as' . $format;
if ($this->hasMethod($method)) {
return call_user_func_array([$this, $method], $params);
return call_user_func_array([$this, $method], array_values($params));
}

throw new InvalidArgumentException("Unknown format type: $format");
Expand Down

0 comments on commit 4c0a00f

Please sign in to comment.