Thanks for contributing to model-orm-php. The project aims to stay small, practical, and dependable across supported databases, so focused changes and clear validation matter.
- Keep changes focused and easy to review.
- Preserve backward compatibility where practical, or call out breaking behavior clearly.
- Favor direct, readable PDO-centered code over extra abstraction.
- Update tests and docs when public behavior changes.
Requirements:
- PHP
8.3+ ext-pdo- A PDO driver for the database you want to test against, usually
pdo_mysqlorpdo_pgsql - Composer
Install dependencies:
composer installStart optional local databases:
docker-compose up -dDefault local ports:
- MySQL/MariaDB on host port
3306 - PostgreSQL on host port
5432
Run the test suite:
vendor/bin/phpunit -c phpunit.xml.distRun static analysis:
vendor/bin/phpstan analyse -c phpstan.neonRun the formatter:
vendor/bin/php-cs-fixer fixCheck formatting without changing files:
vendor/bin/php-cs-fixer fix --dry-run --diffOverride the test connection with environment variables when needed.
MySQL or MariaDB:
MODEL_ORM_TEST_DSN=mysql:host=127.0.0.1;port=3306
MODEL_ORM_TEST_USER=root
MODEL_ORM_TEST_PASS=PostgreSQL:
MODEL_ORM_TEST_DSN=pgsql:host=127.0.0.1;port=5432;dbname=categorytest
MODEL_ORM_TEST_USER=postgres
MODEL_ORM_TEST_PASS=postgres- Follow the existing project style: 4-space indentation,
StudlyCapsclass names, andcamelCasemethods. - Keep the library framework-agnostic.
- Add or adjust tests for behavior changes, especially cross-database behavior.
- Prefer small, well-scoped pull requests over mixed changes.
Before opening a pull request:
- Run PHPUnit for the database setup you changed or relied on.
- Run PHPStan and the formatting check.
- Update documentation when API behavior, setup, or migration guidance changes.
When opening a pull request:
- Describe the problem and the change in user-facing terms.
- Note any database-specific assumptions or compatibility impacts.
- Include the commands you ran to validate the change.
By submitting code, documentation, or other contributions to this repository, you represent that:
- You have the right to submit the contribution.
- The contribution is your own original work, or you have sufficient rights to provide it under the project license.
- You grant the project permission to use, modify, distribute, and relicense the contribution under the repository's existing license and future versions of that license as needed for project maintenance.
If these terms do not work for you, do not submit the contribution until the terms are clarified with the maintainers.