|
| 1 | +# Contributing |
| 2 | + |
| 3 | +If you're here, you would like to contribute to this repository and you're really welcome! |
| 4 | + |
| 5 | + |
| 6 | +## Coding standard |
| 7 | + |
| 8 | +This repository follows the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) and so, if you want to contribute, |
| 9 | +you must follow these rules. |
| 10 | + |
| 11 | + |
| 12 | +## Feature request |
| 13 | + |
| 14 | +If you think a feature is missing, please report it or even better implement it :). If you report it, describe the more |
| 15 | +precisely what you would like to see implemented and we will discuss what is the best approach for it. If you can do |
| 16 | +some search before submitting it and link the resources to your description, you're awesome! It will allow me to more |
| 17 | +easily understood/implement it. |
| 18 | + |
| 19 | + |
| 20 | +## Bug report |
| 21 | + |
| 22 | +If you think you have detected a bug or a doc issue, please report it or even better fix it :). If you report it, |
| 23 | +please be the more precise possible. Here a little list of required informations: |
| 24 | + |
| 25 | + * Precise description of the bug. |
| 26 | + |
| 27 | + |
| 28 | +## Bug fix |
| 29 | + |
| 30 | +If you're here, you are going to fix a bug and you're the best! To do it, first fork the repository, clone it and |
| 31 | +create a new branch with the following commands: |
| 32 | + |
| 33 | +``` bash |
| 34 | +$ git clone git@github.com:your-name/repo-name.git |
| 35 | +$ git checkout -b bug-fix-description |
| 36 | +``` |
| 37 | + |
| 38 | +Then, install the dependencies through [Composer](https://getcomposer.org/): |
| 39 | + |
| 40 | +``` bash |
| 41 | +$ composer install |
| 42 | +``` |
| 43 | + |
| 44 | +When you're on the new branch with the dependencies, code as much as you want and when the fix is ready, don't commit |
| 45 | +it immediately. Before, you will need to add tests and update the doc. For the tests, everything is tested with |
| 46 | +[PHPUnit](http://phpunit.de/) and the doc is in the markdown format under the `doc` directory. |
| 47 | + |
| 48 | +To run the tests, use the following command: |
| 49 | + |
| 50 | +``` bash |
| 51 | +$ vendor/bin/phpunit |
| 52 | +``` |
| 53 | + |
| 54 | +When you have fixed the bug, tested it and documented it, you can commit and push it with the following commands: |
| 55 | + |
| 56 | +``` bash |
| 57 | +$ git commit -m "Bug fix description" |
| 58 | +$ git push origin bug-fix-description |
| 59 | +``` |
| 60 | + |
| 61 | +If you have reworked you patch, please squash all your commits in a single one with the following commands (here, we |
| 62 | +will assume you would like to squash 3 commits in a single one): |
| 63 | + |
| 64 | +``` bash |
| 65 | +$ git rebase -i HEAD~3 |
| 66 | +``` |
| 67 | + |
| 68 | +If your branch conflicts with the master branch, you will need to rebase and repush it with the following commands: |
| 69 | + |
| 70 | +``` bash |
| 71 | +$ git remote add upstream git@github.com:php-http/repo-name.git |
| 72 | +$ git pull --rebase upstream master |
| 73 | +$ git push origin bug-fix-description -f |
| 74 | +``` |
0 commit comments