-
Notifications
You must be signed in to change notification settings - Fork 0
Home
If you detect an error and want to contribute by fixing it or want to add a new feature, you are free to do so. Please, read this document carefully.
At this moment the php minimum compatibility is with php 7.1. Please, the modified/added code must runt in this version.
For ask for a pull request you must add your changes in a feature branch. Please, don't make a pull request from master.
GitHooks follow PSR12 guidelines. This standad is implemented by PHp Code Sniffer (which is a dev dependency) and the complete ruleset is qa/psr12-ruleset.xml.
For check if your changes are folling too PSR12, you can to launch GitHooks in this way:
php bin/githooks tool:phpcs
This fix all autofixable errors and show you the non fixable.
In the same form of Phpcs, GitHooks apply somo rules from Phpmd (phpmd-ruleset.xml).
Only the src code will be checked with Phpmd:
php bin/githooks tool:phpmd
GitHooks pass 8 levels from phpstan. For check the code you can execute:
php bin/githooks tool:phpstan
You can launch all code analyzers (phpcs, phpmd, phpstan) with the project configuration just with one command:
php bin/githooks tool:all
Add or modify the tests you think be needed. For run the complete test suite you can execute vendor/bin/phpunit. Please, don't ask for pull request without tests which check the new feature.
GitHooks has two pipeline flows:
- Feature flow (for feature branches)
- Check php sintaxs and phpcs, phpmd and phpstan errors.
- Launch the test suite on Linux with php 7.4.
- Master (for master branch)
- Check php sintaxs and phpcs, phpmd and phpstan errors.
- Launch the test suite on Linux, Windows and Mac with all php versions supported (7.1, 7.2, 7.3 and 7.4).
When you request for merge your feature branch with master you must ensure that your feature pipeline pass.
- Create feature branches. Don't ask us to pull from your master branch.
-
Check the code. You can run
php bin/githooks tool:all. -
Add tests! Your patch won't be accepted if it doesn't have tests. You can run
vendor/bin/phpunit. - Feature flow must pass.