Skip to content

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

Closed

Description

@njoubert-cleverage

Description

Several dependencies are only needed by a single task (or by an optional feature), but are hard requirements:

Package Used by
symfony/var-dumper ExecuteProcessCommand (--output-format=dump), DebugTransformer, DebugTask: already guarded by class_exists(VarDumper::class)
symfony/stopwatch StopwatchTask
symfony/process CommandRunnerTask, ProcessLauncherTask (through SubprocessInstance)
symfony/monolog-bundle Only the monolog.logger / monolog.processor tags in config/services/*.yaml. The code depends on psr/log (LoggerInterface, LogLevel) and, for the Logger\*Processor classes only (Monolog\LogRecord), on monolog/monolog
symfony/monolog-bridge Not used at all (no Symfony\Bridge\Monolog class)

Proposed fix

  • Move symfony/var-dumper, symfony/stopwatch and symfony/process to suggest (and require-dev).
  • In the tasks using them, fail with an explicit message when the package is missing (e.g. LogicException: StopwatchTask requires symfony/stopwatch, try "composer require symfony/stopwatch"), as Symfony does in its own optional integrations.
  • Replace symfony/monolog-bundle by psr/log in require, and suggest symfony/monolog-bundle to get the cleverage_process* channels. Without MonologBundle the tags are ignored and the default logger is used.
  • Remove symfony/monolog-bridge (unused).
  • monolog/monolog (^3, LogRecord): the processors are only instantiated by MonologBundle (monolog.processor tag), so it can be suggested with MonologBundle; or required if we prefer to keep it simple. To decide in the PR.

Prerequisites

Packages using MonologBundle without requiring it, to fix and release before this change:

The other bridges only use monolog.logger tags (ignored without MonologBundle) and '@logger'.

Requirements

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

Breaking changes

None for applications that already use these packages. An application using one of these tasks without requiring the package gets an explicit error at execution time and must add the package to its composer.json.

Activity

  1. njoubert-cleverage commented on Oct 14, 2026

    @njoubert-cleverage
    MemberAuthor

    Prerequisite: cleverage/ui-process-bundle#150. ui-process-bundle uses Monolog directly (classes, monolog extension configured in prepend(), monolog.logger tags) without requiring it: it only gets symfony/monolog-bundle through process-bundle. #150 must be released before replacing symfony/monolog-bundle by psr/log here. The other bridge bundles should be checked the same way before this change.

  2. njoubert-cleverage commented on Oct 14, 2026

    @njoubert-cleverage
    MemberAuthor

    Update: #274 (PR #287) now requires psr/log ^2|^3 and monolog/monolog ^3 (the lowest-dependencies CI job showed that psr/log 1 and Monolog 2 could not work: typed LoggerInterface signatures, Monolog\LogRecord in the processors). For this ticket: psr/log is already declared; making MonologBundle optional must keep Monolog 3 for the processors (keep monolog/monolog ^3 in require, or move it to suggest with a conflict on monolog/monolog <3).

  3. added 2 commits that reference this issue on Oct 15, 2026
  4. added a commit that references this issue on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions