Skip to content

Introduce a signal bus contract - #390

Merged
techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:signal
Oct 30, 2026
Merged

techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:signal

Conversation

@techmahedy

Copy link
Copy Markdown
Member

Pull Request Checklist

Q A
Branch? 4.x
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

Description

Introduce a signal bus contract so Doppar services can depend on an abstraction rather than the concrete SignalBus implementation. This follows the same pattern as the URL generator, string, storage, mail, hashing and encryption contracts.

Changes

  • Added Phaseolies\Signals\Contracts\SignalBusInterface covering the eight public SignalBus methods: on, forget, hasListeners, emit, emitNow, emitOnSettle, settle and reportFailuresUsing.
  • Updated SignalBus to implement the contract.
  • Bound the contract as a singleton in FacadeLauncher and kept signal as an alias of it.
  • Changed Database::stageSignal() to accept SignalBusInterface instead of the concrete SignalBus.
  • Updated the signal() helper and Signal facade docblocks to reference the contract.
  • Added tests for contract conformance, and for the contract, 'signal' and signal() resolving to the same singleton.

Backward Compatibility

app('signal'), the signal() helper and the Signal facade keep working. The contract and the signal key resolve to the same singleton instance, and no method signatures changed.

Database::stageSignal() now accepts the interface. SignalBus implements it, so every existing caller still type-checks.

Notes

  • settle() is part of the contract because Database calls it when a transaction settles. It is meant for Database, not for application code.

Checklist

  • Tests have been added or updated
  • Documentation has been updated if necessary
  • Code follows the project coding standards
  • All tests pass locally

@techmahedy
techmahedy merged commit b63d118 into doppar:4.x Oct 30, 2026
16 checks passed
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.

1 participant