yceruto/decorator-bundle
A Symfony bundle for applying the decorator pattern to services. Wrap existing implementations with extra behavior, keep original classes untouched, and compose features cleanly for more modular, maintainable applications.
Package identification and scope correction. The release notes reference yceruto/decorator-bundle, which is a Symfony bundle, not a Laravel package. It provides PHP 8 attribute-driven service decoration (#[Decorate], #[Decorator], and a Compound attribute for composing multiple decorators). Before any evaluation proceeds, the "Laravel/PHP package" framing must be corrected: there is no Laravel service provider, facade, config publishing, or Illuminate\Container integration in this codebase. Any Laravel adoption would be an integration project, not a composer require.
Architecture fit. The bundle's value proposition is compile-time wiring: attributes are read by a compiler pass and translated into container decoration definitions, so decorator chains are resolved and validated during container compilation rather than at runtime. This is a strong fit for Symfony's DI architecture and a poor one for Laravel's, where decoration is done imperatively via $this->app->extend() or by rebinding interfaces. The conceptual model (declare decorator relationships at the class level) is portable; the mechanism is not.
Integration feasibility. For a Symfony codebase: high feasibility, low effort, likely a composer require plus bundle registration and a cache clear. For a Laravel codebase: medium-to-high effort. You would need (a) a service provider that scans configured namespaces for the decorator attributes, (b) a translation layer that maps each resolved decorator to container rebinding at boot, and (c) acceptance that decoration now happens at runtime boot rather than compile time, losing static validation. That is bespoke glue with no upstream support and no community precedent to lean on.
Technical risk.
Compound decorator attribute's namespace. Attribute references are string class references resolved lazily by reflection, so a stale namespace will not fail at autoload time — it fails when the container compiles, or worse, silently fails to register decoration if the compiler pass tolerates unresolvable attributes. A namespace relocation shipped as a patch bump is a versioning-hygiene concern and means consumers must not treat ^1.2 as unconditionally safe.Key questions for the maintainer / vendor.
Compound attribute FQCN retained as an alias or class alias, or is v1.2.3 a hard rename? Is the rename logged as BC under the project's versioning policy?symfony/dependency-injection pinned to a major?lint:container and debug:container outputs, and do they survive cache:warmup in read-only production filesystems?Stack fit. Confirm the host framework first. If the target is Symfony 6/7 on PHP 8.1+, this is a clean, idiomatic fit and should be treated as a standard dependency. If the target is Laravel 10/11, treat this as an experimental internal adapter, scoped to a single bounded context (e.g., a payments or notifications pipeline where decorator chains are genuinely needed), never as a platform-wide dependency.
Migration path. No migration is required for new adoption — there is no incumbent to displace. For existing hand-rolled decoration in Laravel (app->extend() chains), the migration is inward, not outward: keep Laravel's native decoration and use the attribute approach as documentation of intent, or skip the package entirely and adopt a lightweight in-house attribute reader. Do not attempt to swap a working extend() chain for a Symfony compiler pass in a live system.
Compatibility.
1.2.3) rather than floating (^1.2) during the trial, and re-verify on each bump.Compound attribute FQCN before upgrading from 1.2.2 or earlier; also grep any string-based references in YAML/XML service config, which reflection will not surface.#[\Attribute] target flags on all decorator attributes in use.autoconfigure/autowire defaults; attribute-driven decoration typically requires classes to be registered as services (public or tagged), which Laravel's zero-config auto-resolution does not replicate.Sequencing.
cache:warmup and lint:container in CI.Maintenance. Low ongoing surface area but non-zero ownership. Attribute-driven container wiring is "magic" to engineers who have not read the compiler pass: the failure mode is an empty or un-decorated service, and the stack trace points at container compilation, not at the decorator. Budget for a short internal write-up and at least one engineer who owns this wiring. If the Laravel adapter is built in-house, that adapter becomes your maintenance burden — not the maintainer's — and must be owned explicitly.
Support. Upstream support is best-effort via GitHub issues from a single maintainer. There is no commercial backing, no LTS commitment, and no security disclosure policy typical of larger projects. For a Laravel team, expect no upstream help with the adapter layer at all. Mitigation: vendor the dependency (fork or composer path repository) if it becomes load-bearing, so a namespace-level fix like v1.2.3 can be applied on your own timeline.
Scaling. Runtime cost is negligible — decoration is resolved at container compile time (Symfony) and therefore costs nothing per request; decorator layers add one delegation hop each, which is irrelevant outside pathological chains. The scaling constraint is human and organizational: the pattern is easy to over-apply, and deep decorator stacks become hard to reason about and hard to trace in logs. Codify a convention (max chain depth, decorators single-responsibility, decorators must not be stateful) or the pattern will degrade into an implicit middleware framework.
Failure modes.
cache:warmup and lint:container.Ramp-up. For Symfony engineers: under a day — the attribute API is small and the docs are adequate. For Laravel engineers: 2–5 days to become productive, gated on understanding Symfony's DI compiler-pass model, which is unfamiliar and easy to misread. Do not expect a Laravel developer to debug a failed container compilation without guidance. Recommend a single spike owner plus a written runbook before any second service adopts the pattern.
Recommendation. Approve for a Symfony stack as a low-risk, pinned dependency with an assertion test per decorated service. Do not approve for a Laravel stack as a direct dependency; if the pattern is genuinely needed, prototype a narrow in-house attribute reader or adapter behind a flag, timeboxed, with the explicit understanding that the adapter is internal code with an internal owner. Regardless of path, treat v1.2.3 as a namespace-migration event, not a routine patch.
How can I help you explore Laravel packages today?