Download the PHP package rokke/contracts without Composer
On this page you can find all versions of the php package rokke/contracts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rokke/contracts
More information about rokke/contracts
Files in rokke/contracts
Package contracts
Short Description Rokke Contracts – Public platform interfaces and shared vocabulary for the Rokke ecosystem.
License MIT
Homepage https://rokke.dev
Informations about the package contracts
rokke/contracts
Public platform contracts for the Rokke Framework — the interfaces and shared vocabulary that define how the platform and its modules communicate.
What this is
rokke/contracts is the dependency anchor of the Rokke ecosystem. Platform modules (rokke/http, rokke/orm, rokke/queue, …) depend on this package to implement platform extension points, without knowing anything about the runtime engine.
This package contains only interfaces and enums. No implementations, no runtime dependencies — just the language of the platform.
Installation
Requires PHP 8.4+.
Contracts
Rokke\Contracts\Module\ModuleInterface
Every platform module implements this. The runtime discovers, boots, and stops modules through this interface.
Rokke\Contracts\Lifecycle\LifecycleEventsInterface
Subscribe to application lifecycle events. Modules use this to react to state changes without controlling transitions.
Available hooks: onBootstrapping, onStarting, onRunning, onStopping, onStopped.
Rokke\Contracts\Lifecycle\ApplicationState
Enum representing the application lifecycle state. Used as shared vocabulary when subscribing to lifecycle events.
Rokke\Contracts\Pipeline\PipelineInterface
Fluent pipeline — send a payload through middleware layers to a final handler.
Rokke\Contracts\Container\ServiceContainerInterface
Dependency injection container extending PSR-11. Supports singleton, scoped, transient, and pooled bindings.
Rokke\Contracts\Resources\ResourceProviderInterface
Consume pooled resources. acquire checks out a resource; release returns it to the pool.
Rokke\Contracts\Context\ContextInterface
Per-coroutine isolated state. Set values at the start of a request; they disappear automatically when the coroutine ends.
Rokke\Contracts\Events\EventBusInterface
Dispatch domain events synchronously, as a coroutine, in the background, or across nodes.
Rokke\Contracts\Configuration\ConfigurationInterface
Read configuration, environment variables, and secrets.
Rokke\Contracts\Time\ClockInterface
Testable time abstraction.
Governing criterion
A contract lives here if and only if multiple legitimate implementations can exist outside the runtime engine.
ModuleInterface→ any module author implements it → hereWorkerManagerInterface→ only the runtime implements it → rokke/runtime
Stability
This package is intentionally the most stable in the Rokke ecosystem. Breaking changes require architectural justification. Treat every interface here as a signed API contract.
New interfaces start as internal contracts inside their first module and are promoted here only after two or more independent modules prove the abstraction.
License
MIT