-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
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.
- 1. Php Minimum Compatibility
- 2. Create a Feature Branch
- 3. Check Static Code
- 4. Add tests
- 5. CI Pipelines
- 6. Resume
At this moment the php minimum compatibility is with php 7.1. Please, the modified/added code must run in this version.
Create a feature branch from master to make your changes.
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 githooks tool:phpcs
This fixes all autofixable errors and show you the non fixable.
In the same way of Phpcs, GitHooks applies some rules from Phpmd (phpmd-ruleset.xml
).
Only the src
code will be checked with Phpmd:
php githooks tool:phpmd
GitHooks pass 8 levels from phpstan. To check the code you can execute:
php githooks tool:phpstan
You can launch all code analyzers (phpcs
, phpmd
, phpstan
) with the project configuration just with one command:
php githooks tool all
Add or modify any test that you think that is needed to test your changes. For run the complete test suite you can execute vendor/bin/phpunit
. Please, don't make a pull request without the corresponding tests.
GitHooks has setted GitHub Actions flows. This flows check static code and run the tests suite.
When you request for merge your feature branch with master you must ensure that your ci pipeline pass.
- Create feature branches.
-
Check the code. You can run
php githooks tool all
. -
Add tests! Your patch won't be accepted if it doesn't have tests. You can run
vendor/bin/phpunit
. - CI flows must pass.