Repository navigation
#269 - Make process, stopwatch, var-dumper and monolog-bundle optional dependencies - #296
Merged
Merged
Conversation
…l dependencies - symfony/process, symfony/stopwatch, symfony/var-dumper and symfony/monolog-bundle are suggested instead of required (the first three in require-dev for the tests). - Without symfony/process (CommandRunnerTask, ProcessLauncherTask) or symfony/stopwatch (StopwatchTask), the container compiles and these tasks fail with an explicit message (UnavailableServicesCompilerPass). - monolog/monolog stays required (Logger\*Processor); remove the unused symfony/monolog-bridge. - Conflict with cleverage/doctrine-process-bundle, soap-process-bundle and ui-process-bundle <3.3, which use the MonologBundle without requiring it. - Documentation: optional packages in the quick start, task reference pages, logging section. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ProcessConfiguration uses array_any() (PHP 8.4): the polyfill was only installed through the packages that are no longer required (CI lowest failure: "Call to undefined function array_any()"). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…yfill-php84 ProcessConfiguration::getDependencyGroups() no longer uses array_any() (PHP 8.4), whose polyfill was only installed through the packages that are no longer required: symfony/polyfill-php84 is not required. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 #269: the dependencies only needed by a single task or an optional feature are suggested instead of required.
Changes
symfony/process,symfony/stopwatch,symfony/var-dumper:require→suggest(+require-dev, used by the tests).symfony/monolog-bundle:require→suggest(not needed by the tests). The code only depends onpsr/log(already required).monolog/monolog^3stays required: theLogger\*Processorclasses useMonolog\LogRecord(decision of the issue: keep it simple).symfony/monolog-bridge: removed (noSymfony\Bridge\Monologclass used).ProcessConfiguration::getDependencyGroups()uses a loop instead ofarray_any()(PHP 8.4): its polyfill,symfony/polyfill-php84, was only installed through the removed packages (failure of the lowest CI job without it), so no new dependency is needed.conflict:cleverage/doctrine-process-bundle,cleverage/soap-process-bundle,cleverage/ui-process-bundle<3.3. Their releases up to 3.2 use the MonologBundle without requiring it (ui#150, doctrine#42, soap#37: fixed on theirmain, not released yet), so this avoids depending on the release order.UnavailableServicesCompilerPass, same mechanism as CheckSerializerCompilerPass: do not fail the container compilation when the serializer is disabled #278): the container still compiles and the task fails with an explicit message when it is used:symfony/stopwatch(nodebug.stopwatchservice):StopwatchTask→The "…\StopwatchTask" service requires the Symfony Stopwatch component, which does not seem installed: try "composer require symfony/stopwatch".symfony/process:CommandRunnerTask,ProcessLauncherTask→ same message forsymfony/process.symfony/var-dumper: nothing is dumped, as before (class_existsguards inDebugTask,DebugTransformer,--output-format=dump). In practice it is installed bysymfony/error-handler.symfony/monolog-bundle: themonolog.logger/monolog.processortags are ignored, the default logger is used.command_runner,process_launcherandstopwatchreference pages, MonologBundle in the logging section. CHANGELOG (Latest).Checks
composer update --no-dev, so without process, stopwatch and monolog-bundle): the container compiles,command_runnerandstopwatchfail with their message,debugworks.UnavailableServicesCompilerPassTest: Stopwatch and Process tasks kept / replaced. 957 tests (also with--prefer-loweston PHP 8.2), PHPStan, PHP-CS-Fixer, Rector OK.Requirements
Breaking changes
None for applications that already use these packages. An application using
CommandRunnerTask,ProcessLauncherTaskorStopwatchTask, or thecleverage_process*log channels, without requiring the package gets an explicit error (or the default logger) and must add the package to itscomposer.json.🤖 Generated with Claude Code