Before you contribute code, please make sure it conforms to the PSR-2 coding standard and that the unit tests still pass. The easiest way to contribute is to work on your own fork.
If you do this, you can run the following commands to check if everything is ready to submit.
In order to load the dependencies, you should run composer:
composer install
This package follows the PSR-2 coding standard.
To test if your contribution passes the standard, you can use the command:
./vendor/bin/phpcs --standard=phpcs.xml
Which should give you no output, indicating that there are no coding standard errors.
You can write your own tests and add them to the tests
directory.
To run the test command:
./vendor/bin/phpunit --configuration phpunit.xml --coverage-text
Which should give you no failures or errors.
A coverage and logs will be created in the build
directory.
In order to give support to older versions, you should test it also with the lowest composer packages:
composer update --prefer-stable --prefer-lowest
As a guideline, please follow this process:
- Fork the repository.
- Create a topic branch for the change:
- New features should branch from develop.
- Bug fixes to existing versions should branch from master.
- Please ensure the branch is clearly labelled as a feature or fix.
- Make the relevant changes.
- Squash commits if necessary.
- Submit a pull request to the develop branch.
Please note this is a general guideline only. For more information on the branching structure please see the git-flow cheatsheet.