Welcome! We look forward to your contributions. This document outlines the guidelines for contributing to php-cypher-dsl. Keep in mind that these guidelines are mostly just suggestions, and shouldn't hold you back from improving php-cypher-dsl. Don't be afraid to ignore them.
Below are some examples on how you can contribute:
This project has a Contributor Code of Conduct. By contributing to or participating in this project, you agree to abide to its terms.
When submitting code or changes, your submissions will automatically be licensed under the GNU General Public License version 2.0 or later. By contributing to this project, you agree that your contributions will be licensed under its terms.
In your bug report, you should provide the following:
- A short summary of the bug
- What you expect would happen
- What actually happens
- Steps to reproduce
- Be specific! Give sample code if possible.
- Include the version of PHP and php-cypher-dsl.
You should only report bugs for versions of php-cypher-dsl that are supported. Please only report bugs if you are using a php-cypher-dsl with a compatible version of PHP.
Feel free to propose a new feature by opening an issue for it.
- Fork the repository.
- Create a new branch.
- If you are implementing new functionality, create your branch from
development
. - If you are fixing a bug, create your branch from the oldest supported branch that is affected by the bug.
- If you are implementing new functionality, create your branch from
- Implement your change and add tests for it.
- Make sure the test suite passes.
- Make sure that the code complies with the coding guidelines (see below).
- Submit your pull request!
Some things to keep in mind:
- Make sure that you have configured a user name and email address for use with Git.
- Keep backwards compatibility breaks to a minimum.
- You are encouraged to sign your commits with GPG.
The branching model used by this project is gitflow, with the following changes/additions:
- Feature branches must follow the naming convention
feature/*
. - The name of a feature branch should reflect the feature added (e.g.
feature/support-indexing-operator
instead offeature/feature-1
). - Release branches must follow the naming convention
release/x.y
, wherex
andy
are the major and minor version of the release respectively. A release branch should never be made for a patch. - Hotfix branches must follow the naming convention
hotfix/x.y.z
, wherex
,y
andz
are the major, minor and patch version of the hot respectively. - Hotfix branches must branch off from the oldest supported branch that is affected by the bug.
- Right before a new major version is released, a support branch is created from
main
. - Support branches must follow the naming convention
support/x.y
, wherex
andy
are the major and minor version of the most recent release respectively.
This project comes with a configuration file for php-cs-fixer
that you can use to format your code:
$ php vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php
This project uses PHPStan for static analysis:
$ php vendor/bin/phpstan
After making your changes and adding your tests, you can check whether the minimum coverage and minimum mutation score indicator requirements are still met:
$ XDEBUG_MODE=coverage php vendor/bin/phpunit --testsuite unit
$ php vendor/bin/coverage-check coverage/clover.xml 90
$ XDEBUG_MODE=coverage php vendor/bin/infection --min-msi=80
To run all tests, use:
$ php vendor/bin/phpunit --no-coverage
To only run unit tests, use:
$ php vendor/bin/phpunit --testsuite unit --no-coverage
To only run end-to-end tests, use:
$ php vendor/bin/phpunit --testsuite end-to-end --no-coverage