Weave Code
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

Clobber Laravel Package

pcov/clobber

Clobber PHPUnit 5–7’s Xdebug code coverage driver to use PCOV instead. Install with composer and run vendor/bin/pcov clobber or unclobber (optionally targeting another directory). Useful when upgrading to PHPUnit 8 isn’t feasible.

View on GitHub
Deep Wiki
Context7

Run PCOV in versions of PHPUnit before 8, if you must ...

Frequently asked questions about Clobber
Why would I need pcov/clobber in a Laravel project?
If your Laravel app (5.x–7.x) uses PHPUnit 5–7 and requires PCOV for code coverage but can’t upgrade due to void return type conflicts or third-party constraints, this package swaps Xdebug’s coverage driver with PCOV without modifying core Laravel code. It’s a temporary workaround for CI/CD pipelines or legacy systems.
Does pcov/clobber work with Laravel’s built-in phpunit.xml?
Yes, it operates at the PHPUnit layer, so it’s fully compatible with Laravel’s default phpunit.xml configuration. Just run `vendor/bin/pcov clobber` before tests and `unclobber` afterward if needed. No Laravel-specific changes are required.
What Laravel versions support pcov/clobber?
This package works with Laravel 5.8–8.x, as it targets PHPUnit 5–7. For Laravel 9+ (PHPUnit 8+), native PCOV support eliminates the need for this tool. If you’re on Laravel 5.x–7.x with PHPUnit 5–7, it’s a viable solution.
How do I integrate pcov/clobber into my CI pipeline?
Add `composer require pcov/clobber` to your dev dependencies, then run `vendor/bin/pcov clobber` before tests in your CI script (e.g., GitHub Actions, GitLab CI). Use `unclobber` post-test to revert changes. Example: `php vendor/bin/pcov clobber && phpunit --coverage-text && php vendor/bin/pcov unclobber`.
Will this break parallel testing in Laravel?
Parallel testing (e.g., `phpunit --parallel`) may fail if multiple processes try to clobber/unclobber simultaneously. Test in a staging environment first, or avoid parallel mode until you confirm compatibility. Race conditions are the primary risk.
What if I already have Xdebug or PCOV extensions installed?
The package assumes Xdebug is installed (versions 2.9–3.2) and will override its coverage driver. If you’re using custom Xdebug extensions or PCOV forks, conflicts may arise. Test thoroughly in a staging environment before production use.
Can I use pcov/clobber with Laravel Testbench?
Yes, since Testbench relies on PHPUnit, pcov/clobber will work seamlessly. Just ensure Testbench’s PHPUnit configuration isn’t overriding coverage drivers. Run `vendor/bin/pcov clobber` before Testbench tests as you would for regular Laravel tests.
What’s the performance impact of using PCOV vs. Xdebug?
PCOV is generally faster than Xdebug for coverage collection, but the overhead depends on your test suite size. Benchmark locally with `time vendor/bin/phpunit --coverage-text` before and after clobbering to compare. In CI, monitor runtime changes.
Are there alternatives to pcov/clobber for Laravel?
If you can upgrade to PHPUnit 8+, native PCOV support removes the need for this package. For Laravel 5–7, alternatives include manually configuring PCOV in phpunit.xml (if supported) or using Xdebug 3+ with PHPUnit 7.5+. However, these may not resolve void return type issues.
How do I roll back if pcov/clobber corrupts my environment?
Always run `vendor/bin/pcov unclobber` after tests to restore Xdebug. If issues persist, manually edit your PHPUnit configuration to revert coverage settings. Backup your original phpunit.xml or Xdebug config before clobbering for safety.
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.
croct/coding-standard
croct/plug-php
nqxcode/phpmorphy
boundwize/pyrameter
testo/facade
develia/commons
dmstr/symfony-system-resources-bundle
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
renatomarinho/laravel-page-speed
develia/geo-bundle
austinheap/laravel-database-encryption
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme