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.
Scoped\Acme\Billing\Invoice instead of Acme\Billing\Invoice) directly raise time-to-diagnosis for support engineers and make customer bug reports unusable. That is a recurring operational cost, and prefix removal is a small, measurable lever against it. Frame the build/buy/fork decision in support hours saved per release, not developer convenience.Consider it only when all of the following hold:
Look elsewhere — or write it in-house — when:
str_replace/preg_replace helper at our output boundaries. This is usually the better answer: no license exposure, no abandonment risk, no coupling to PHP-Scoper's non-public output format.$_SERVER traces. Extension points are essentially nil; we would be writing the wrapper anyway.To executives: This is a small cleanup utility for one specific distribution strategy — shipping self-contained PHP products with bundled dependencies. Its only value is making production errors readable again once we've protected our artifacts from dependency collisions. It is not a strategic dependency: it is a 2021-era, single-maintainer, GPL-3.0 package with 10 stars, zero dependents, and no release in four years. My recommendation is to treat it as a reference implementation rather than a dependency. The capability is roughly fifty lines of string handling, and we should own it in-house under our own license. That protects us from copyleft exposure and a bus factor of one at essentially no engineering cost.
To engineering: Low effort, low confidence. It is Composer-native, PHP-only, framework-agnostic, and tiny — integration cost is hours, not sprints. The constraint is provenance, not complexity: nobody has publicly validated it against PHP 8.2+ or current PHP-Scoper, and the package removes prefixes from strings handed to it, not from get_class() at the source, so don't expect transparent aliasing. If we adopt it, adopt it deliberately — require-dev or explicit scoped-build inclusion, exact version pin, invoked immediately after the php-scoper step, golden-file regression test in CI, and a smoke test that instantiates the remover via its scoped FQCN. The dominant engineering risk is fragility: prefix removal is literal string manipulation, and an off-by-one backslash produces a silent no-op while an over-broad pattern corrupts legitimate class names in ways that only fail at runtime inside a customer's install. The dominant non-engineering risk is license contamination if anything runtime-facing ships. Read src/ first — it's an hour — and settle build-time vs. runtime before spending integration time. 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 demands a parallel config that can drift.
Ask: Approve a one-day spike plus an early legal review of the GPL question as the gate. Expected outcome is a small internal helper in our release pipeline, with this package credited as the reference. Escalate only if the spike shows the in-house version is materially more complex than it appears.
How can I help you explore Laravel packages today?