Thank you for your interest in contributing to this project! We welcome contributions from the community.
- Fork the repository on GitHub
- Clone your fork locally
- Create a feature branch from
main - Make your changes
- Test your changes thoroughly
- Submit a pull request
- PHP 7.4 or higher
- Composer
- Database server (MySQL, PostgreSQL, SQLite, or SQL Server)
- Make (for build automation)
# Clone your fork
git clone git@github.com:YOUR_USERNAME/php-ease-fluentpdo.git
cd php-vitexsoftware-ease-fluentpdo
# Install dependencies
composer install
# Set up test environment
cp tests/.env.example tests/.env
# Edit tests/.env with your database credentials
# Run database migrations
cd tests
../vendor/bin/phinx migrate
../vendor/bin/phinx seed:run
cd ..- PSR-12: Follow PHP coding standard
- Strict Types: Use
declare(strict_types=1); - Type Hints: Use type declarations for all parameters and return types
- PHPDoc: Document all classes, methods, and properties
Before submitting a PR, ensure your code passes:
# Run tests
make phpunit
# Static analysis
make static-code-analysis
# Code style fixes
make cs
# Or run all checks
composer test- Use snake_case for table and column names
- Primary keys should be named
id - Foreign keys should follow
table_name_idpattern - Always use migrations for schema changes
- Include both up and down migrations
- Write unit tests for all new functionality
- Include integration tests for database operations
- Test edge cases and error conditions
- Maintain or improve code coverage
- Unit Tests: Test individual methods and classes
- Integration Tests: Test database interactions
- Performance Tests: Verify query performance
- Edge Case Tests: Test boundary conditions
# All tests
make phpunit
# Specific test file
./vendor/bin/phpunit tests/src/Ease/SQL/EngineTest.php
# With coverage
./vendor/bin/phpunit --coverage-html coverage/# Create new migration
make newmigration
# Enter migration name when prompted
# Create seed file
make newseed
# Enter seed name when prompted- Reversible: Always include both
up()anddown()methods - Data Safety: Never delete data without explicit confirmation
- Performance: Consider impact on large tables
- Testing: Test migrations on sample data
- PHPDoc: Use proper PHPDoc blocks for all public methods
- Examples: Include usage examples in docblocks
- Types: Specify parameter and return types accurately
- Update
README.mdfor user-facing changes - Update
WARP.mdfor development-related changes - Add entries to
CHANGELOG.mdfollowing Keep a Changelog format
- Rebase on latest
mainbranch - Test all functionality works correctly
- Lint code passes all quality checks
- Document changes in CHANGELOG.md
- Review your own changes for completeness
Include in your PR:
- Summary of changes made
- Motivation for the changes
- Testing performed
- Breaking Changes if any
- Related Issues (use "Fixes #123" to auto-close)
- PRs require at least one approval
- All CI checks must pass
- Maintainers may request changes
- Be responsive to feedback
Include:
- Environment: PHP version, database type, OS
- Steps to Reproduce: Minimal example
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Error Messages: Full stack traces
Describe:
- Use Case: Why is this needed?
- Proposed Solution: How should it work?
- Alternatives: What other approaches exist?
- Breaking Changes: Would this break existing code?
We support multiple database engines:
- MySQL: Primary development database
- PostgreSQL: Full support
- SQLite: For testing and lightweight applications
- SQL Server: Basic support
When adding features, consider compatibility across all supported databases.
- Query Optimization: Use appropriate indexes
- Connection Management: Consider persistent connections
- Memory Usage: Avoid loading large datasets into memory
- Caching: Implement appropriate caching strategies
- SQL Injection: Always use prepared statements
- Input Validation: Validate all user inputs
- Secrets: Never commit passwords or keys
- Dependencies: Keep dependencies updated
- Be respectful and inclusive
- Help others learn and grow
- Share knowledge and best practices
- Follow the code of conduct
- Check existing Issues
- Review project Documentation
- Contact: info@vitexsoftware.cz
Thank you for contributing! 🙏