phpro/grumphp
GrumPHP helps you enforce code quality on every git commit. Configure tasks like PHPStan, PHPUnit, PHPCS, and more to run as pre-commit hooks, failing fast on issues so your team keeps a consistent, clean, and build-ready codebase.
Start by installing GrumPHP via Composer in your project: composer require --dev phpro/grumphp. Run ./vendor/bin/grumphp init to generate the default grumphp.yml configuration file. This creates hooks in .git/hooks/ to run checks on every commit. Your first use case is likely enforcing code style: configure PSR-12 compliance by adding phpcs or php-cs-fixer tasks in the config, then commit a file with style violations to see it blocked and auto-fixed.
phpcs, phpstan, pest, composer validate) in grumphp.yml under tasks:—GrumPHP runs them in order and halts on first failure.phpcs: {standard: PSR12, ignore_patterns: [var/*]}) to avoid noise from generated files.grumphp.sh or grumphp.bat wrappers to pass context (e.g., --skip-tests during hotfix commits) via arguments or env vars../vendor/bin/grumphp run --no-progress --verbose to CI pipelines; configure grumphp-ci.yml to exclude interactive prompts and format output for CI logs.--show-formatters for human-readable output..git/hooks/pre-commit. If using other tools (e.g., Husky via Git hooks), integrate via .githooks/ or use grumphp run --hook to bypass automatic hook management.parallel: true). If reproducible failures occur, disable parallelism or add stop_on_failure: false to isolate flaky tasks.ignore_patterns and use grumphp run --only-changed (via custom task wrapper) to limit scope.grumphp.yml, run ./vendor/bin/grumphp configure:remove-cache to force reload.GrumPHP\Task\ConfigurableTaskInterface implementations and register them in grumphp.yml under extensions: or via a custom grumphp.php script.How can I help you explore Laravel packages today?