stevebauman/unfinalize
Unfinalize is a Composer plugin for Laravel and PHP projects that strips the final keyword from vendor classes, making third-party classes easier to extend, decorate, or mock in tests without editing package source.
stevebauman/unfinalize as a build-time development utility, not a runtime application dependency. It mutates Composer-installed vendor source so final classes/methods can be extended or mocked. That fits Laravel/PHP projects only when the need is localized to tests, local development, or a temporary integration shim. It is a poor architectural fit if production code depends on vendor files being modified at deploy time.composer install/composer update and before autoload-dependent tests. Docker and CI integration are feasible by adding the command to image build or a Composer script. Production use is not recommended because composer install --no-dev or a clean deploy can remove the tool and restore final classes.final is usually behavior-neutral unless subclasses are introduced, but it can invalidate package design assumptions and encourage extending internals. The package itself is niche (147 stars, score ~3.3), so internal ownership and pinning are required.final? Can the vendor package accept an upstream PR? Does the tool support selective targets, idempotency, and PHP parsing rather than fragile regex? How is it invoked after every Composer operation? Does it work with the project’s PHP/Laravel/Composer versions? How will CI prove the vendor tree is correctly unfinalized? What is the rollback path? Does production need the same modified vendor, and if so why not use a fork or Composer patch?final classes/methods actually blocking work. Attempt an upstream PR first. If a temporary workaround is justified, add the tool as a dev dependency, configure selective package paths, and run it from a Composer post-autoload-dump or CI build step. For production needs, fork the vendor package or use a patch mechanism so the change is reproducible from composer.lock, rather than relying on a local vendor mutation.final, does not touch unrelated files, and is safe to run repeatedly. Test with opcache enabled and with authoritative classmaps. Pin the version and review changes before upgrades.composer install reproduces the state. 6) Document rollback and remove the workaround once upstream ships.final; CI or production lacks the post-install step; package update reintroduces final; regex-based edits corrupt vendor files; tests pass locally but fail in clean CI; production fatals with “cannot extend final class”; opcache/preload serves stale code; vendor drift is invisible to composer.lock; parallel Composer scripts race. Rollback is usually composer install plus rebuild, but production failures can be severe if the mutation was assumed.How can I help you explore Laravel packages today?