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

Quality Laravel Package

endroid/quality

Quality-related helper package by Endroid for PHP/Laravel apps, providing small utilities for enforcing or improving code/data quality in your project. Suitable as a lightweight dependency when you need simple quality checks or supporting components.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is not a runtime validation library—it’s a configuration aggregator for PHP quality tools (PHPUnit, PHPStan, PHP-CS-Fixer, Psalm). In Laravel, it’s only relevant if you’re building library packages (e.g., a Composer package published to Packagist), not for typical app development. To start:

  1. Install it as a dev dependency in your library project: composer require --dev endroid/quality
  2. Copy its config templates into your repo root:
    cp vendor/endroid/quality/phpunit.xml.dist .  
    cp vendor/endroid/quality/phpstan.neon.dist .  
    cp vendor/endroid/quality/.php_cs.dist .  
    cp vendor/endroid/quality/psalm.xml.dist .  
    
  3. Adjust paths in phpunit.xml.dist (e.g., <directory suffix="Test.php">src/Tests</directory>) to match your test structure.
    First use case: Run vendor/bin/phpunit—it should pick up the config and execute tests with sane defaults (e.g., code coverage, testdox output).

Implementation Patterns

  • Library-only: Only use this in dedicated Composer packages—not in Laravel apps (app/, routes/, app/Http/Controllers). Laravel apps should rely on phpunit.xml generated by laravel new or Pest.
  • Override selectively: Extend presets instead of replacing them:
    • In phpstan.neon: includes: ['vendor/endroid/quality/phpstan.neon.dist']
    • In .php_cs.dist: $finder = $finder->in(['src', 'tests'])->name('*.php'); (then chain your own rules)
  • CI integration: Use its recommended GitHub Actions workflow matrix (PHP 8.0–8.3, lowest/highest deps) as a reference—don’t copy blindly; adjust based on your package’s supported versions.
  • Minimal churn: Since it’s config-only, update infrequently and lock versions (e.g., endroid/quality:^4.0) to avoid breaking changes.

Gotchas and Tips

⚠️ No runtime impact: This package does not validate input in your app (contrary to its vague description). It solely configures static analysis and testing tools.
⚠️ Version drift risk: Its config templates often lag behind tool releases (e.g., Psalm 5 configs when Psalm 6 is current). Check composer show endroid/quality for the last release date before updating.
⚠️ Laravel app conflict: Installing this in a Laravel app will overwrite your default phpunit.xml—which uses Orchestra/Testbench or Pest by default. You’ll break php artisan test.
💡 Fix config conflicts: If PHPStan errors complain about missing parameters.phpstan.neon, create it and import the preset via imports: [{resource: 'vendor/endroid/quality/phpstan.neon.dist'}].
💡 Combine with Pest: For libraries using Pest, keep endroid/quality for static analysis (PHPStan/PSalm/PHP-CS-Fixer) and configure phpunit.xml to use Pest via <phpunit bootstrap="vendor/pestphp/pest/bin/pest">.
💡 Audit tool versions: Run composer show -i | grep -E "(phpunit|phpstan|psalm|php-cs)" to verify compatible tool versions before relying on its config.

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