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

Coverage Guard Laravel Package

shipmonk/coverage-guard

Enforce PHP code coverage in CI by targeting specific core methods/blocks instead of overall %. Legacy-friendly: enforce only new/changed code via git patch. Lightweight (nikic/php-parser), extensible rules, easy CLI to check PHPUnit Clover reports.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: Excellent alignment with Laravel's standard PHPUnit-based testing setup. Uses common coverage formats (clover.xml) that Laravel projects already generate, with minimal dependencies (nikic/php-parser). Integrates seamlessly with Laravel's test workflow without requiring framework-specific modifications.
Integration feasibility: High. Requires only composer require --dev and adding a single CI command after PHPUnit execution. The init command generates a starter config, enabling zero-configuration first use. Path mapping and patch handling are straightforward for CI environments.
Technical risk: Low. MIT license and active maintenance (1.0.0+ releases). However, future-dated release (2026-01-02) suggests potential data error, and 0 dependents indicate limited real-world adoption. Key risks: path mismatches between local/CI environments (if addCoveragePathMapping not configured), and potential false negatives if minExecutableLines is set too high for Laravel's dynamic methods.
Key questions: How does it handle Laravel's dynamic method calls (e.g., __call in Facades)? Does it support Laravel's test helpers (e.g., actingAs()) in coverage analysis? What's the performance impact on CI pipelines for large codebases?

Integration Approach

Stack fit: Ideal for Laravel 9+ (PHP 8.1+ requirement). Fully compatible with Laravel's default PHPUnit setup, including phpunit.xml coverage configuration. Works with PCOV/XDebug and integrates with PhpStorm/GitLab visualization tools.
Migration path: Start with coverage-guard init → customize rules for new code only (--patch mode) → gradually expand coverage rules to legacy code. For existing projects, use path mapping to align CI/local paths. Phase 1: enforce coverage only on new/modified files. Phase 2: add rules for critical components (e.g., Controllers, Repositories).
Compatibility: Requires PHP 8.1+. Works with all PHPUnit versions and Laravel 8+ (if PHP upgraded). Supports all PHPUnit coverage formats but strongly recommends clover.xml for IDE/GitLab compatibility.
Sequencing: 1) Install package and generate config. 2) Update CI to generate clover.xml after tests. 3) Add coverage-guard check --patch to CI pipeline for new code enforcement. 4) For parallel jobs, use merge

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport