Download the PHP package flyokai/generic without Composer
On this page you can find all versions of the php package flyokai/generic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package generic
flyokai/generic
User docs →
AGENTS.mdBuilder, tuner, and execution-pipeline patterns expressed with PHPDoc generics — a tiny but pervasive primitive across Flyokai.
The package gives you four parametric interfaces — State<T>, Builder<T>, Tuner<T>, Execution<T> — plus DI-aware containers that compose them. Tuners are how Flyokai lets multiple modules contribute settings to one shared object (an InputDefinition, a Router, an ACL builder, …) without coupling them.
Features
State<T>/Builder<T>— generic state holder + builder pipelineTuner<T>/TunerContainer<T>— composable, ordered state mutatorsExecution<TContext>/ExecutionContainer<TContext>— composable side-effect runnersInvalidStateException— base for builder validation errors- Fully PHPDoc-
@templateannotated for static analysers
Installation
Quick start
Composing tuners
TunerContainer accepts an Amp\Injector\Composition of Tuner<T> instances — each module registers its own tuner via DI and ordering (before/after/depends) decides who runs when.
Executions
Execution<TContext> is the side-effect cousin of Tuner — it runs against a context but does not return modified state:
Subclassing ExecutionContainer and overriding executeChild() lets you inject hooks (timing, error handling) around every child execution.
Where it shows up
flyokai/symfony-console—InputStateisState<InputInterface>;RequiredOptionHandlerand friends are tuners.flyokai/application— ACL Builder, RouterBuilder, ServerBuilder all expose tuner compositions so modules can extend them.flyokai/data-service,flyokai/oauth-server—RouterBuildermiddleware and route registration.
Gotchas
BuilderImplisabstract; you must subclass to constrain the generic parameter.- Tuner order in a
TunerContaineris significant — wire ordering carefully viacompositionItem(...)before/after/depends. ExecutionContainerdoes not aggregate return values — they are intentionallyvoid.- PHPDoc
@templateannotations are static-analysis only; nothing enforces the type at runtime.
See also
flyokai/amphp-injector— provides theCompositionmechanismTunerContainerandExecutionContainerrely on.
License
MIT