Thank you for considering contributing! This document outlines the process for contributing to this project.
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
We use git-flow workflow and conventional commits.
main- Production-ready codedevelop- Development branchfeature/*- New featuresbugfix/*- Bug fixeshotfix/*- Critical production fixes
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/wp-boot.git - Create a feature branch:
git checkout -b feature/your-feature-name - Install dependencies:
composer install - Make your changes
- Run tests:
composer test - Run quality checks:
composer qa - Commit using conventional commits
- Push and create a pull request
- PHP 8.0 or higher
- Composer
- Git
git clone https://github.com/wp-spaghetti/wp-boot.git
cd wp-boot
composer install# Run all tests
composer test
# Run specific test suite
vendor/bin/phpunit tests/FooTest.php
# Run with coverage
vendor/bin/phpunit --coverage-html coverage/# Run all quality checks
composer quality
# Individual tools
composer lint # Linters
composer analysis # Static analysis
composer security # Security check
composer quality # Code quality- Follow PSR-12 coding standard
- Use strict typing:
declare(strict_types=1); - Document all public methods with PHPDoc
- Use meaningful variable and method names
We use Conventional Commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changes (no logic changes)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
Examples:
feat(environment): add support for custom environment detection
fix(docker): improve container detection accuracy
docs(readme): update installation instructions
test(hooks): add comprehensive hook testing
<?php
declare(strict_types=1);
namespace WpSpaghetti\ExampleNamespace;
/**
* Class documentation.
*/
class ExampleClass
{
/**
* Method documentation.
*/
public function exampleMethod(string $param): bool
{
// Method implementation
return true;
}
}- Unit tests in
tests/directory - Test files should end with
Test.php - Use descriptive test method names
- Include both positive and negative test cases
public function testMethodReturnsExpectedValue(): void
{
$result = ExampleClass::get('TEST_VAR', 'default');
self::assertSame('expected', $result);
}Use the provided mock functions for testing:
set_mock_*()
- All public methods must have PHPDoc blocks
- Include
@paramand@returnannotations - Document complex logic with inline comments
- Use clear, concise language
When adding new features:
- Update the feature list
- Add usage examples
- Update the API reference if needed
-
Create Feature Branch
git checkout develop git checkout -b feature/your-feature
-
Make Changes
- Write code following the standards above
- Add/update tests for your changes
- Update documentation if needed
-
Test Your Changes
composer quality # Run all quality checks composer test # Run all tests
-
Commit Changes
git add . git commit -m "feat: add new feature description"
-
Push and Create PR
git push origin feature/your-feature
Then create a pull request against the
developbranch.
- All tests must pass
- Code coverage should not decrease
- Follow the PR template
- Link to related issues
- Use conventional commit messages
Releases are automated through GitHub Actions:
- Merge to
maintriggers release workflow - Conventional commits determine version bump
- Changelog is automatically updated
- GitHub release is created
- Packagist is notified
If you discover a security vulnerability, please follow our Security Policy.
- Create an issue for questions about usage
- Join discussions for feature planning
- Contact maintainers for sensitive issues
By contributing, you agree that your contributions will be licensed under the GPL-3.0-or-later license.
Contributors will be recognized in:
- GitHub contributors list
- Release notes for significant contributions
- README acknowledgments for major features
Thank you for contributing! 🎉