Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Scoper Prefix Remover Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Does it run build-time only, or does it ship a runtime component into the scoped artifact? This single answer determines whether GPL propagates.
  • Has legal cleared GPL-3.0 against the actual consumption model — build-time-only vs. runtime-shipped?
  • Does it support our PHP-Scoper version and our exact configured prefix literal?
  • Does it read our existing scoper.inc.php, or demand duplicate configuration that can drift?
  • What PHP constraint ships in its composer.json, and does that run on our current CI image?
  • Is prefix-removal logic configurable — custom prefixes, allow/deny lists, regex, nested arrays — or hard-coded?
  • Is there test coverage, and does it operate on source files, serialized traces, or both?
  • Is there a maintained alternative or credible fork, or would adoption make us the de facto maintainer?

Integration Approach

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.

  1. Legal review of GPL-3.0 against the intended consumption model — the gate for everything downstream, and cheap to run early.
  2. Source audit — read src/ directly; at this size a full read costs an hour and settles the build-time-vs-runtime question definitively.
  3. Timeboxed spike on a throwaway branch: scope a representative artifact, run the remover, compare stack traces and autoload behavior before and after on PHP 8.x and current PHP-Scoper.
  4. Golden-file regression check in CI so silent drift in prefix handling fails loudly rather than shipping.
  5. Disposition decision: adopt pinned, fork under a compatible license, or reimplement. Document the choice and the internal owner.

Operational Impact

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.

  • Silent no-op: prefix literal or escaping doesn't match what PHP-Scoper actually emitted. Traces stay prefixed, nobody notices until a customer escalates.
  • Over-broad match: legitimate class names containing a prefix-like substring get mangled, producing wrong error messages or broken reflection/serialization only at runtime inside a customer install.
  • Toolchain drift: a PHP-Scoper upgrade changes prefix conventions or config shape; the shim keeps "working" while producing incorrect output.
  • License propagation: a runtime helper ships inside a proprietary artifact and contaminates distribution terms — discovered at the worst possible moment, typically during a customer or partner legal review.
  • Bus-factor failure: a breakage coincides with the maintainer's absence, leaving us to patch code we don't own on the release team's critical path.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast