Skip to content

Composer Commands

Quick reference for all available Composer 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)

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