Thank you for your interest in contributing! We welcome bug reports, feature requests, and pull requests.
- Fork the repository
- Clone your fork:
git clone git@github.com:your-username/chip-php-sdk.git - Install dependencies:
composer install - Run tests:
composer test
# Run all tests
composer test
# Run a specific test
./vendor/bin/phpunit tests/ApiTest.php --filter testCreatePurchaseWe use PHPStan at level 8. All code must pass:
composer phpstanWe use PHP-CS-Fixer with the PSR-12 preset. Check style before committing:
composer cs-checkAuto-fix issues:
composer cs-fixIf you need to run php-cs-fixer on PHP 8.0 (e.g., for CI compatibility):
docker run --rm -v "$(pwd)":/app -w /app php:8.0-cli bash -c "
./vendor/bin/php-cs-fixer fix --dry-run --diff --config=.php-cs-fixer.dist.php
"- Create a feature branch:
git checkout -b feature/my-feature - Make your changes with tests
- Ensure all tests pass:
composer test - Ensure PHPStan passes:
composer phpstan - Ensure code style is clean:
composer cs-check - Commit with a clear message
- Push and open a Pull Request
When reporting bugs, please include:
- PHP version
- SDK version
- Steps to reproduce
- Expected vs actual behavior
- Stack trace if applicable
Be respectful and constructive in all interactions.