Skip to content

Composer Commands

Quick reference for all available Composer commands.

CommandDescription
composer testRun PHPUnit test suite
composer analyseRun PHPStan static analysis (Level 8)
composer cs-checkCheck code style (PSR-12)
composer cs-fixAuto-fix code style issues
composer check-allRun all checks (tests + analyse + cs-check)

Terminal window
# Run all tests
composer test
# Run specific test file
vendor/bin/phpunit tests/Valicomb/Rules/StringValidationTest.php
# Run specific test method
vendor/bin/phpunit --filter testEmailValidation
# Generate coverage report
vendor/bin/phpunit --coverage-html coverage/

Always run the full quality check:

Terminal window
composer check-all

If code style issues are found:

Terminal window
composer cs-fix