Download the PHP package stougeiro/event-contract without Composer
On this page you can find all versions of the php package stougeiro/event-contract. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stougeiro/event-contract
More information about stougeiro/event-contract
Files in stougeiro/event-contract
Package event-contract
Short Description Minimal event contract defining lightweight interfaces for dispatching string-based events and registering listeners in modular PHP applications.
License MIT
Informations about the package event-contract
Event Contract
Minimal event contract package defining the core interfaces for a plug-and-play event system. Provides a lightweight EventManagerInterface for dispatching string‑based events and registering listeners, along with a simple EventListenerInterface for building modular, high‑performance PHP applications.
✨ Features
-
Lightweight event dispatcher
Dispatches string-based events with zero overhead and no required event classes. -
Simple listener model
Listeners are invokable classes, allowing full freedom for dependency injection. -
Plug-and-play architecture
Any event implementation can be swapped without changing application code. -
Framework-agnostic
Works with any PHP project, from microframeworks to full-stack applications. - High performance
Minimal abstractions designed for fast execution, ideal for shared hosting environments.
📦 Installation
Install via Composer:
🔧 Implementations
Below is a list of known implementations maintained by the community.
stougeiro/event
Repository: https://github.com/stougeiro/event
🧠 Why?
Because event systems don’t need to be complex. This contract defines the smallest possible interface for an event dispatcher, enabling developers to build fast, modular applications without the overhead of class‑based events or heavy abstractions.
By using simple string identifiers and invokable listeners, any event engine can be implemented — synchronous, asynchronous, queued, file‑based, or custom — while keeping a consistent interface across the entire application.
This promotes flexibility, testability, and high performance, especially in environments with limited resources.
🤝 Contributions
Contributions are welcome. Feel free to open issues or submit pull requests.
