Thank you for your interest in contributing to Diffyne! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to abide by our Code of Conduct.
Before creating bug reports, please check the issue list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
- Clear title and description
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Environment details (PHP version, Laravel version, Diffyne version, browser)
- Code examples or minimal reproduction case
- Screenshots if applicable
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Clear title and description
- Use case: Why is this enhancement useful?
- Proposed solution: How should it work?
- Alternatives: What alternatives have you considered?
- Fork the repository and create your branch from
main - Make your changes following our coding standards
- Add tests for new functionality
- Ensure all tests pass (
composer test) - Run PHPStan (
composer analyse) - must pass with 0 errors - Check code formatting (
composer format:test) - must pass - Update documentation if needed
- Create a pull request using our PR template
- PHP 8.3 or higher
- Composer
- Node.js and npm (for frontend assets)
# Clone the repository
git clone https://github.com/diffyne/diffyne.git
cd diffyne
# Install dependencies
composer install
# Install dev dependencies (already included)# Run all tests
composer test
# Run with coverage
composer test -- --coverage
# Run specific test file
vendor/bin/pest tests/Feature/YourTest.php# Run PHPStan (static analysis)
composer analyse
# Check code formatting
composer format:test
# Auto-fix formatting issues
composer formatWe use PHP CS Fixer with PSR-12 standards. The configuration is in .php-cs-fixer.php.
Key guidelines:
- Follow PSR-12 coding standard
- Use type hints wherever possible
- Add PHPDoc comments for public methods
- Keep methods focused and small
- Use meaningful variable and method names
- PHPStan Level 7: All code must pass PHPStan level 7 with 0 errors
- Type hints: Use strict type hints for parameters and return types
- Array types: Always specify array value types in PHPDoc (
@var array<string, mixed>)
- Write tests for all new features and bug fixes
- Use Pest for testing (already configured)
- Test coverage: Aim for high test coverage, especially for critical paths
- Test names: Use descriptive test names that explain what is being tested
- Update README.md if adding new features
- Add examples in the docs repository for new features
- Update feature docs in the docs repository if applicable
- Add PHPDoc comments for all public methods
We follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(component): add lazy loading support
Add #[Lazy] attribute to enable lazy component loading
with placeholder support.
Closes #123
fix(renderer): fix state normalization for nested arrays
The state normalization was not handling nested arrays
correctly, causing signature verification failures.
Fixes #456
- Update your branch with the latest
mainbranch - Ensure all checks pass:
- PHPStan analysis
- Code formatting
- All tests
- Fill out the PR template completely
- Request review from maintainers
- Address review feedback promptly
- Wait for approval before merging
packages/diffyne/
├── src/ # Source code
├── tests/ # Test files
├── config/ # Configuration files
├── resources/ # Views and assets
└── stubs/ # Code generation stubs
- Open a GitHub Discussion
- Check existing Issues
- Email: xentixar@gmail.com
Thank you for contributing to Diffyne! 🎉