Skip to content

Fix AbstractProcessingHandler::handle() to call getBubble() instead of $this->bubble#2031

Open
philbates35 wants to merge 1 commit into
Seldaek:mainfrom
philbates35:fix/monolog-bridge-interactive-only-propagation
Open

Fix AbstractProcessingHandler::handle() to call getBubble() instead of $this->bubble#2031
philbates35 wants to merge 1 commit into
Seldaek:mainfrom
philbates35:fix/monolog-bridge-interactive-only-propagation

Conversation

@philbates35
Copy link
Copy Markdown

Summary

  • AbstractProcessingHandler::handle() was reading the protected $bubble property directly (false === $this->bubble) rather than calling getBubble()
  • This means subclasses that override getBubble() to dynamically control bubbling behaviour are silently bypassed
  • Fix: replace with !$this->getBubble() so the getter is always honoured

Context

This was discovered while working on a Symfony MonologBridge fix where a handler needed to override getBubble() to conditionally suppress propagation based on runtime state. The Symfony maintainers suggested the fix belongs upstream in Monolog: symfony/symfony#64207

…f reading \$bubble directly

Subclasses that override getBubble() to dynamically control bubbling behaviour
were bypassed because handle() read the protected \$bubble property directly.
Switching to !$this->getBubble() ensures the getter is always respected.

Regression test added to AbstractProcessingHandlerTest.

Relates to symfony/symfony#64207

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@philbates35 philbates35 marked this pull request as ready for review May 15, 2026 12:35
@philbates35 philbates35 changed the title Fix AbstractProcessingHandler::handle() to call getBubble() instead o… Fix AbstractProcessingHandler::handle() to call getBubble() instead of $this->bubble May 15, 2026
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.

2 participants