Composer Commands
Quick reference for all available Composer commands.
Commands
Section titled “Commands”| Command | Description |
|---|---|
composer test | Run PHPUnit test suite |
composer analyse | Run PHPStan static analysis (Level 8) |
composer cs-check | Check code style (PSR-12) |
composer cs-fix | Auto-fix code style issues |
composer check-all | Run all checks (tests + analyse + cs-check) |
Running Tests
Section titled “Running Tests”# Run all testscomposer test
# Run specific test filevendor/bin/phpunit tests/Valicomb/Rules/StringValidationTest.php
# Run specific test methodvendor/bin/phpunit --filter testEmailValidation
# Generate coverage reportvendor/bin/phpunit --coverage-html coverage/Before Committing
Section titled “Before Committing”Always run the full quality check:
composer check-allIf code style issues are found:
composer cs-fix