pxlrbt/php-scoper-prefix-remover
Removes PHP-Scoper prefixes from prefixed class names and namespaces, helping you inspect or debug scoped code. Useful when you need unprefixed references back after running php-scoper.
Architecture fit. This is not a Laravel package in any meaningful sense — it is a build-pipeline post-processing shim for PHP-Scoper. Its only architectural role is in a distribution model where we ship self-contained PHP artifacts: scoped WordPress plugins/themes with vendored dependencies, distributed PHARs, or white-label Laravel packages designed to avoid class collisions in a host application. In a conventional Laravel application resolving dependencies through Composer, PHP-Scoper never runs and this package has no role. The TPM framing is therefore not "should we adopt this library" but "does the prefixed-class-name problem exist in our distribution model, and is a third-party shim the right owner of the fix."
Integration feasibility. Engineering effort is low; confidence is also low. The package is small and Composer-native, likely one class plus a thin helper, so a spike is measured in hours rather than sprints. The feasibility constraint is provenance, not complexity: 10 stars, zero dependents, no release since 2021-11-30, and no public validation against current PHP 8.x or PHP-Scoper versions. Treat compatibility as unproven until demonstrated on our CI image and our scoped artifact. Budget for vendoring or reimplementation as the likely landing zone.
Technical risk. The dominant risk is licensing, not code. GPL-3.0 is strong copyleft. Consumed strictly as a build-time dev tool that never enters the shipped artifact, exposure is confined to tooling. But the credible usage pattern here — a runtime exception handler or Monolog processor that strips prefixes so production stack traces stay readable — embeds GPL code in the distributed output, which propagates copyleft to the whole work and is a hard blocker for proprietary distribution. That determination gates every downstream hour of engineering. Secondary risks: abandonment with a single maintainer and no recent release; fragility because prefix removal is literal string manipulation, where an off-by-one backslash produces silent no-ops and an over-broad pattern corrupts legitimate class names; version coupling to PHP-Scoper's configuration and output conventions, which are not a stable public contract; and scope confusion, because the package removes prefixes from strings handed to it, not from get_class() at the source.
Key questions.
scoper.inc.php, or demand duplicate configuration that can drift?composer.json, and does that run on our current CI image?Stack fit. Composer-native, PHP-only, no framework coupling — favorable at the tooling layer. Laravel fit depends entirely on runtime surface: if the package is build-time only, "Laravel fit" reduces to CI fit, and Laravel is irrelevant. If it ships a runtime helper, Laravel integration means a service-provider registration or a bootstrap call wrapping the global exception handler — precisely the pattern that triggers the GPL question above. In an ordinary Laravel application, there is no fit.
Migration path. Treat it as a pipeline stage, not a library dependency. Add it under require-dev with an exact version pin, invoke it immediately after the php-scoper step, and diff the produced artifact against a stored baseline. If a runtime variant proves necessary, that is a separate, legally reviewed decision; do not let it in through the dev-dependency door. A credible and probably preferable outcome is a roughly 50-line internal helper in the release pipeline that we own outright and can extend — case-insensitive matching, regex rules, nested-array walking — without inheriting the license or the bus factor.
Compatibility. Verify three things before committing budget: the package's PHP constraint against our CI image, the supported PHP-Scoper major/minor, and whether it consumes our existing scoper.inc.php or requires a parallel config. For a 2021 artifact, assume breakage until demonstrated on the current toolchain.
Sequencing.
src/ directly; at this size a full read costs an hour and settles the build-time-vs-runtime question definitively.Maintenance. Effectively unmaintained. Zero dependents means no downstream pressure to fix breakage and no external signal that anyone has validated it recently. Adopting it means owning it: fork, add tests, pin. The absolute cost is low because the codebase is small, but it lands on whoever owns the release pipeline, who is now responsible for a niche tool's correctness.
Support. Single volunteer maintainer, no SLA, no security disclosure process, no release cadence. Not acceptable as a critical-path dependency without a named internal owner and a fork. The 10-star baseline also means community troubleshooting is thin — problems become our problems immediately.
Scaling. Technically negligible: build-time processing scales with artifact count and source volume, not request throughput, and imposes no runtime footprint under the build-only reading. The scaling concern is organizational — every additional scoped artifact multiplies the surface where a prefix mismatch can silently ship, and the cost of diagnosing it lands on support and on-call rather than on the build team that introduced it. If we ship multiple scoped artifacts, the right answer is one shared internal utility owned by the platform team, versioned with our pipeline, and exercised by every artifact's CI — not one pinned third-party copy per repository.
Failure modes.
Ramp-up. Hours, not days. The real ramp-up is not learning the package but establishing the pipeline discipline around it: pinning, a golden-file regression harness, a documented post-scoper invocation step, and an owner. That harness is worth building regardless of disposition and is the artifact we should insist on from the spike. My recommendation to stakeholders is unchanged and simple: approve a one-day spike plus an early legal review of the GPL question as the gate, expect the outcome to be a small in-house helper credited to this package as reference, and escalate only if the spike shows the internal version is materially more complex than it appears.
How can I help you explore Laravel packages today?