sylius-labs/polyfill-symfony-event-dispatcher
Symfony EventDispatcher Polyfill for projects that need compatible event dispatching without depending on a specific Symfony EventDispatcher version. Useful for libraries and apps supporting multiple Symfony versions or minimizing hard dependencies.
Purpose: This package was designed to polyfill Symfony’s EventDispatcher component for older PHP/Symfony versions (pre-8.0, pre-6.4). However, v1.2.0+ drops all polyfilling logic, making it effectively a no-op wrapper for Symfony 6.4+ or 7.0+ EventDispatcher.
Use Case Fit:
EventDispatcher is already fully supported.EventDispatcher interface (e.g., for compatibility with Symfony-based libraries), this could act as a lightweight dependency—but only if the project already uses Symfony components.Key Limitation: The package is now a dead-end—it no longer polyfills anything. A TPM should avoid recommending it unless maintaining legacy codebases stuck on pre-1.2.0 versions.
EventDispatcher).EventDispatcher.EventDispatcher, so swapping it in/out is theoretically safe.EventDispatcher and refactor polyfill-dependent code.EventDispatcher? If so, Symfony’s standalone component is a better choice.EventDispatcher (no polyfill needed).EventDispatcher is fully functional.EventDispatcher interface but isn’t using the full framework, this could serve as a lightweight dependency.symfony/event-dispatcher component.| Scenario | Migration Steps |
|---|---|
| Symfony 6.4/7.0+ (v1.2.0+) | 1. Remove the package (it’s a no-op). |
2. Replace use SyliusLabs\PolyfillSymfonyEventDispatcher\EventDispatcher; with use Symfony\Component\EventDispatcher\EventDispatcher; |
|
| Legacy Symfony (<6.4, v1.1.0) | 1. Lock to v1.1.0 (v1.2.0+ breaks polyfill logic). |
| 2. Document the hard dependency on this version. | |
3. Plan for future migration to native EventDispatcher when upgrading Symfony. |
|
| Non-Symfony Project | 1. Replace with symfony/event-dispatcher (more actively maintained). |
| 2. Configure DI manually if not using Symfony’s container. |
EventDispatcherInterface, but no added functionality in v1.2.0+.use statements and service configurations.symfony/event-dispatcher) exist.How can I help you explore Laravel packages today?