Repository navigation
#309 - Composer: suggest ext-intl instead of requiring it - #313
Merged
Merged
Conversation
- ext-intl moves from require to suggest: only the slugify transformer uses it (\Transliterator, intl_get_error_message()). - UnavailableServicesCompilerPass: without the extension, the slugify transformer is replaced by an UnavailableTransformer failing with an explicit message when it is used (same approach as #278 / #269). - Tests: the transformer is replaced without intl, kept with it. Documentation (quick start, slugify reference) and CHANGELOG updated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #309.
composer.json:ext-intlmoves fromrequiretosuggest("Required by the slugify transformer"). It is only used bySlugifyTransformer(\Transliterator,intl_get_error_message()).UnavailableServicesCompilerPass: without the extension (\Transliteratornot found), theslugifytransformer is replaced by anUnavailableTransformer(same code, same tag) failing with an explicit message when it is used, as for the serializer, validator, Stopwatch and Process (CheckSerializerCompilerPass: do not fail the container compilation when the serializer is disabled #278, Composer: make var-dumper, stopwatch, process and monolog-bundle optional dependencies #269). NewINTL_MESSAGEconstant.slugifyreference page. CHANGELOG.Tests
UnavailableServicesCompilerPassTest: the transformer is kept with intl, replaced without it (intlparameter ofcreateContainer()).composer updateinstalls the bundle, the kernel boots (tests/FunctionalOK), theslugifytransformer throwsThe "...SlugifyTransformer" service requires the PHP intl extension....Checked in the container (978 tests): highest dependencies (PHP 8.5, Symfony 8.1), lowest dependencies (PHP 8.2, Symfony 6.4.0), Symfony 6.4.48 on PHP 8.2 and 8.5, Symfony 7.4: no deprecation, no risky test (with pcov coverage). PHPStan, PHP-CS-Fixer and Rector OK.
Requirements
Breaking changes
None for the bundle API. An application relying on the bundle to require
ext-intlkeeps it installed;composerno longer refuses to install the bundle without it.🤖 Generated with Claude Code