Contribution
Introductionβ
All contributions are welcome! Contributing to BowPHP is a great way to grow your skills and help the community.
Discuss first
Before starting any significant work, create an issue on GitHub to discuss your proposal with the maintainers.
Main repositoriesβ
| Repository | Description |
|---|---|
| bowphp/framework | Framework core |
| bowphp/app | Skeleton application |
| bowphp/docs | Documentation |
Contribution processβ
1. Fork and cloneβ
# Fork the project on GitHub, then clone it
git clone https://github.com/VOTRE-USERNAME/framework.git
cd framework
# Add the upstream repository
git remote add upstream https://github.com/bowphp/framework.git
2. Create a branchβ
# Sync with upstream
git fetch upstream
git checkout -b feat/ma-fonctionnalite upstream/5.x
Naming conventions:
feat/description- New featurefix/description- Bug fixdocs/description- Documentationrefactor/description- Refactoring
3. Developβ
# Install dependencies
composer install
# Run the tests during development
composer test
# Readable format with testdox (method names as sentences)
composer testdox
4. Commitβ
Use the Conventional Commits convention:
# Format: type(scope): description
git commit -m "feat(auth): add OAuth2 support for Google"
git commit -m "fix(session): resolve token expiration issue"
git commit -m "docs(readme): update installation instructions"
Available types:
feat- New featurefix- Bug fixdocs- Documentationrefactor- Refactoring with no functional changetest- Adding/modifying testschore- Maintenance (dependencies, CI, etc.)
note
Commit messages must be written in English.
5. Submit the Pull Requestβ
# Push the branch
git push origin feat/ma-fonctionnalite
On GitHub, create a Pull Request with:
- A clear title following Conventional Commits
- A description of the changes
- A reference to the related issue (e.g.
Fixes #123)
Rulesβ
Pull Requestsβ
- One PR per feature: Separate independent changes
- Tests required: Every new feature must be tested
- Documentation: Update the docs if needed
- Versioning: Follow SemVer for major changes
Code qualityβ
# Check the style (read-only, fails on PSR-12 deviations)
composer phpcs
# Automatically fix style deviations
composer phpcbf
# Run all tests
composer test
# Static analysis (PHPStan is in require-dev)
vendor/bin/phpstan analyse src
Standardsβ
- PHP 8.1+
- PSR-12 for code style (checked by
phpcs, fixed byphpcbf) - PHPDoc for public methods
- Unit tests with PHPUnit (configuration:
phpunit.dist.xml)
Commit examplesβ
# Simple feature
git commit -m "feat(http): add support for PATCH requests"
# Bug fix
git commit -m "fix(routing): handle trailing slashes correctly"
# Commit with a detailed description
git commit
feat(auth): implement JWT authentication
- Add JwtGuard for token-based authentication
- Support token refresh and revocation
- Add middleware for protected routes
Closes #42
Code of conductβ
Respect the code of conduct in all your interactions.
Resourcesβ
Is something missing?
If you run into problems with the documentation or have suggestions to improve the documentation or the project in general, please open an issue for us, or send a tweet mentioning the Twitter account @bowframework or directly on github.