goaop/goaop-symfony-bundle
Go! AOP Symfony Bundle brings aspect-oriented programming to Symfony apps, letting you define aspects and advice to intercept service methods. It adds bundle configuration, AOP cache warming, and console tooling for weaving aspects into your code.
Architecture fit. Low for a Laravel codebase. This package is a Symfony bundle — its entire surface area is Symfony-specific: a Bundle subclass, a compiler pass that collects services tagged as aspects, kernel boot hooks, and a cache warmer wired into Symfony's cache:warmup. None of that resolves in Laravel's container, and the package cannot be installed into a Laravel app as-is because its Composer constraints are pinned to the Symfony 3.4/4.x era (last release February 2018). The only transferable asset is the pattern: an AspectContainer implementation that pulls aspect instances out of the host DI container, plus a build-time weaving cache warmer. That pattern is roughly 200–400 lines to reimplement against Laravel's ServiceProvider and an Artisan command.
The underlying engine (goaop/framework) is the part with actual capability, and it is framework-agnostic. It performs load-time source transformation by registering a stream wrapper that rewrites classes as they are autoloaded, generating proxied code into an aspect cache directory. That mechanism is what matters; the bundle is a thin, dated adapter.
Integration feasibility. Feasible but non-trivial, and only as a build-it-yourself effort:
--classmap-authoritative / --optimize-autoloader modes interact badly with the stream-wrapper interception path; classes resolved from a static classmap can bypass weaving. You must verify weaving empirically per autoload strategy.opcache.preload and JIT bypass the wrapper entirely — transformed code must be pre-woven into the cache directory and the cache made the authoritative source at deploy time, not at request time.AspectContainer is a process-global singleton, so any per-request state inside an aspect leaks across requests.Technical risk. High. The package is explicitly labeled outdated, has zero dependents, no maintainer-backed CVE process, and no releases in roughly seven years. It is unmaintained supply-chain surface. The engine underneath is fragile by design: correctness depends on PHP parser compatibility with your exact runtime version, on cache invalidation being perfect across deploys, and on developers understanding that stack traces and dd() output point at generated proxies rather than their source. Upgrading PHP minors becomes a re-validation event, not a routine bump.
Key questions.
ray/aop or a narrower attribute-driven proxy/interceptor library acceptable instead?Stack fit. Treat this repository as a reference implementation, not a dependency. Do not add it to composer.json. If AOP is approved, depend on goaop/framework directly (after verifying its PHP version support against your runtime) and write a first-party Laravel bridge: a ServiceProvider that registers the aspect kernel, a Laravel-backed AspectContainer adapter resolving aspects via app(), a config file mapping include/exclude path patterns to app/ rather than src/, and an Artisan aop:weave command invoked in the deploy pipeline.
Migration path. There is no migration from this bundle — there is only a greenfield bridge. Sequence it as:
goaop/framework in a throwaway Laravel app, weave one app/ class, confirm behavior under default autoload, -o, --classmap-authoritative, with and without opcache. Output: a go/no-go on weaving reliability. This is the cheapest possible kill switch — run it before any design work.storage/framework versioning, deploy-step documentation.Compatibility. Pin the engine to an exact patch version and record the PHP versions validated. Add an automated smoke test that boots the app, resolves a woven class, and asserts interception — this is the regression that catches upstream breakage on every upgrade. Exclude vendor/ and framework internals from weaving to bound cache size and risk. Document that Octane deployments must reset aspect state per request or forbid stateful aspects outright.
Sequencing note. Do not run the weaving step and the application on the same filesystem without a versioned cache directory; concurrent deploys will interleave partially-woven classes.
Maintenance. Effectively unmaintained upstream for the bundle; the engine has more activity but is a small-team project with a correspondingly small bus factor. If adopted, you own the adapter and inherit an implicit obligation to fork the engine on any PHP upgrade that breaks the parser. Budget this as a standing line item, not a one-off integration cost.
Support. No vendor, no support contract, no guaranteed security response. Any CVE in the parser or stream-wrapper path is yours to patch. This is the single strongest argument against adoption in a regulated or long-lived codebase.
Scaling. Weaving cost is paid at build/deploy time, which is the right place — but the aspect cache directory grows with the woven class count and must be shipped to every node. Deploy time increases modestly; cold-start behavior under preload/JIT needs explicit validation. Runtime overhead per intercepted call is small but non-zero and applies to every woven class, so scope inclusion tightly. Octane compatibility requires deliberate work: process-global aspect container plus singleton aspects equals cross-request state leakage, and debugging that class of bug is expensive.
Failure modes. Ranked by cost of discovery:
final; behavior is simply the un-aspect version with no error. Highest risk; mitigate with a startup assertion.Ramp-up. Steep for the team, not for the tooling. AOP is a concept most Laravel developers have never worked with, and the failure modes above are all "invisible until you know to look." Expect 2–3 sprints before the team is productive, plus permanent onboarding cost for every new engineer. Given a 54-star, seven-year-stale bundle with zero dependents, that education investment is buying access to a mechanism that Laravel's middleware, events, observers, and container decoration already cover for the majority of real use cases. Recommend the one-week spike as the only committed spend, with a strong default posture of not adopting.
How can I help you explore Laravel packages today?