Skip to content

#269 - Make process, stopwatch, var-dumper and monolog-bundle optional dependencies - #296

Merged
njoubert-cleverage merged 3 commits into
mainfrom
269
Oct 15, 2026
Merged

njoubert-cleverage merged 3 commits into
mainfrom
269

Conversation

@njoubert-cleverage

@njoubert-cleverage njoubert-cleverage commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #269: the dependencies only needed by a single task or an optional feature are suggested instead of required.

Changes

  • composer.json
    • 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 on psr/log (already required).
    • monolog/monolog ^3 stays required: the Logger\*Processor classes use Monolog\LogRecord (decision of the issue: keep it simple).
    • symfony/monolog-bridge: removed (no Symfony\Bridge\Monolog class used).
    • ProcessConfiguration::getDependencyGroups() uses a loop instead of array_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.
    • New 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 their main, not released yet), so this avoids depending on the release order.
  • Missing packages (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:
    • without symfony/stopwatch (no debug.stopwatch service): StopwatchTask → The "…\StopwatchTask" service requires the Symfony Stopwatch component, which does not seem installed: try "composer require symfony/stopwatch".
    • without symfony/process: CommandRunnerTask, ProcessLauncherTask → same message for symfony/process.
    • without symfony/var-dumper: nothing is dumped, as before (class_exists guards in DebugTask, DebugTransformer, --output-format=dump). In practice it is installed by symfony/error-handler.
    • without symfony/monolog-bundle: the monolog.logger / monolog.processor tags are ignored, the default logger is used.
  • Docs: optional packages table in the quick start, requirement line on the command_runner, process_launcher and stopwatch reference pages, MonologBundle in the logging section. CHANGELOG (Latest).

Checks

  • Minimal kernel (FrameworkBundle + this bundle, composer update --no-dev, so without process, stopwatch and monolog-bundle): the container compiles, command_runner and stopwatch fail with their message, debug works.
  • UnavailableServicesCompilerPassTest: Stopwatch and Process tasks kept / replaced. 957 tests (also with --prefer-lowest on PHP 8.2), PHPStan, PHP-CS-Fixer, Rector OK.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None for applications that already use these packages. An application using CommandRunnerTask, ProcessLauncherTask or StopwatchTask, or the cleverage_process* log channels, without requiring the package gets an explicit error (or the default logger) and must add the package to its composer.json.

🤖 Generated with Claude Code

njoubert-cleverage and others added 3 commits October 15, 2026 13:32
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composer: make var-dumper, stopwatch, process and monolog-bundle optional dependencies

1 participant