Skip to content

Twig intl-extra depends on intl PHP extension, but does not declare such dependency #4702

@urbanecm

Description

@urbanecm

twig/intl-extra depends on intl PHP extension. However, it is possible to install even on systems without that extension (composer install succeeds). In that case, its usage would end up with a quite mysterious error:

PHP Fatal error:  Uncaught Error: Class "IntlDateFormatter" not found

As https://www.php.net/manual/en/class.intldateformatter.php says, the IntlDateFormatter class is defined by the extension.

composer.json supports declaring dependencies on PHP extensions as well (by depending on ext-intl). I propose we add that dependency, which would make composer.json complain directly when installing.

Maybe the goal is to provide a fallback implementation somewhere (https://github.com/symfony/polyfill-intl-icu/tree/1.x?tab=readme-ov-file seems to be providing it, although that package is deprecated), but it doesn't seem intended to fail on usage. Whether the expected behaviour is "fail on install" or "use a fallback", I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions