Skip to content

[Intl] Add format_list filter using PHP 8.5's IntlListFormatter#4852

Open
BreyndotEchse wants to merge 3 commits into
twigphp:3.xfrom
BreyndotEchse:feature/intl-php8.5-format-list-filter
Open

[Intl] Add format_list filter using PHP 8.5's IntlListFormatter#4852
BreyndotEchse wants to merge 3 commits into
twigphp:3.xfrom
BreyndotEchse:feature/intl-php8.5-format-list-filter

Conversation

@BreyndotEchse

Copy link
Copy Markdown

Adds a new format_list Twig filter to IntlExtension that formats arrays using using PHP 8.5's IntlListFormatter

On PHP < 8.5, using the filter throws a RuntimeError explaining the dependency on IntlListFormatter (Checks if class_exists to allow polyfills).

CI workflow only covered up to PHP 8.4, so I extended it to also run PHPUnit against 8.5.
phpstan's PHP version also bumped to 8.5.

Comment thread extra/intl-extra/IntlExtension.php Outdated
@BreyndotEchse BreyndotEchse requested a review from stof July 1, 2026 17:40

@fabpot fabpot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

Can you add a new doc/filters/format_list.rst file (see doc/filters/format_number.rst for an example), update doc/filters/index.rst to add format_list to the list and in extra/intl-extra/README.md?

Also, can you add an entry in CHANGELOG.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants