Contributing
Sugar is actively developed and welcomes contributions. Check out the issues or submit a PR.
TIP
Keep PRs focused and small when possible. It is easier to review, test, and ship.
Workflow
- Create a branch.
- Add or update tests with your change.
- Run the checks locally.
- Open a PR with a clear description and screenshots for docs or UX changes.
WARNING
All PRs must be green in CI before they can be merged.
Testing and Quality Tools
Sugar ships with a full test and analysis toolchain. Use the Composer scripts so local checks match CI.
bash
composer testbash
composer phpstanbash
composer cs-check
composer cs-fixbash
composer rector-check
composer rector-fixWhat each tool does
- PHPUnit: Executes the unit and integration tests.
- PHPStan: Static analysis for type and logic issues.
- PHPCS/PHPCBF: Code style enforcement and auto-fixes.
- Rector: Automated refactoring based on project rules.
CI Expectations
Every PR is expected to pass tests and static analysis. If a change breaks a check, update the code or the tests until CI is green.