phphd/pipeline-bundle
A Symfony bundle for building reusable PHP pipelines with a clean, stage-based API. Chain processing steps, pass data through each stage, and organize complex workflows into testable, configurable components that fit naturally into Symfony applications.
Architecture fit
The release introduces #[NextForwarded], a PHP 8 attribute that declares a message's next forwarding target, plus phd_pipeline.forward_chain, a middleware alias that walks the resulting chain. This maps cleanly onto Laravel's existing Illuminate\Pipeline\Pipeline and the middleware-alias convention already used for HTTP kernels and queued job chains. Routing intent lives on the message class (declarative, colocated, discoverable via IDE "find usages") rather than in a config array or a switch statement — a pattern Laravel developers will already recognise from #[Route]-style attribute routing in other ecosystems. Net: strong conceptual fit, low conceptual surface area, no new runtime dependency implied by the note.
Integration feasibility
The integration unit appears to be one alias registration plus one attribute per message DTO — genuinely small. Feasibility is high if three things hold, none of which the release note evidences: (1) the attribute is read from the message class rather than requiring a per-call registration; (2) chain resolution is bounded and rejects cycles at boot/compile time rather than at dispatch; (3) the middleware composes with dispatch(), Bus::chain(), and queue middleware without double-forwarding. Each is a verification task, not a design objection.
Technical risk
#[NextForwarded] pair converts one inbound message into an unbounded queue/CPU loop. This is the single largest risk and needs an explicit cycle-detection answer plus a depth cap.Key questions
#[NextForwarded] attributes — stop, throw, or log?phd_ namespace — internal team, vendor, or single maintainer?Illuminate\Pipeline a hard dependency or reimplemented?Stack fit
Laravel (10/11/12 assumed, unverified) with PHP 8.1+ for attribute syntax. Compatible with queue-backed and synchronous pipelines, and with HTTP middleware if the package registers against the router kernel. If the team already uses Bus::chain() or job middleware for multi-step dispatch, this package largely replaces hand-rolled forwarding logic — a net reduction in bespoke code, which is the main argument for adoption.
Migration path Greenfield package with no prior assessment and no installed base, so migration is purely additive:
phd_pipeline.forward_chain in the relevant pipeline/kernel configuration.#[NextForwarded] behind a feature flag.Compatibility
Unknown and must be pinned down before the spike: the package's laravel/framework and php constraints, whether attributes are resolved via ReflectionClass (cheap) or ReflectionMethod (broader but slower and more ambiguous), and whether the middleware alias name phd_pipeline.forward_chain is stable across patch releases. The dotted alias is unconventional for Laravel (which favours short snake_case keys) — confirm it is the documented public name and not an internal key that leaked into the changelog.
Sequencing Spike (2–3 days) → cycle/termination test harness → shadow mode → single-consumer canary → breadth → legacy decommission. Do not sequence breadth before the cycle-detection question is answered in writing; that one answer determines whether the rollout plan is viable at all.
Maintenance
Small, focused package — low ongoing maintenance burden and cheap to vendor or fork if the upstream stalls. Counterweight: a phd_-prefixed namespace with no stated maintainer, release cadence, or security policy. Pin to an exact version, commit the lockfile, and identify a named internal owner who can read the source before adopting across services.
Support Operational support hinges on the runbook, not the code. Required artefacts: a documented way to dump the resolved chain for a given message class, a clear statement of no-op versus throw behaviour, and a defined escalation path for the vendor/namespace. Support cost is low if the attribute map is introspectable; it becomes high if the only way to know a chain's shape is to read source.
Scaling Cost per message is roughly reflection on the message class plus O(chain length) hops. At low volume this is invisible; at high volume two effects matter — reflection lookups repeated per dispatch (mitigated only by caching, which reintroduces the Octane staleness risk), and queue amplification, where a chain of length k turns one inbound message into k jobs. Capacity planning must model k, not raw inbound rate. Backpressure on the chain's terminal hop propagates backwards through every preceding hop.
Failure modes
#[NextForwarded] target → resolution failure at runtime, likely only on the affected branch.Ramp-up Low for anyone fluent in Laravel middleware and PHP 8 attributes — realistically half a day to first productive annotation, two to three days to be genuinely safe including the cycle/termination test harness. The learning cost is concentrated in the chain-resolution semantics and failure behaviour, not the API, which is a single attribute and a single alias. Budget the shadow-mode diff exercise as the real ramp-up activity; it is where the team converts "this looks convenient" into a defensible answer about whether chained forwarding reproduces the existing routing behaviour exactly.
How can I help you explore Laravel packages today?