|
| 1 | +# Contributing |
| 2 | + |
| 3 | +If you're here, you would like to contribute to this repository and you're really welcome! |
| 4 | + |
| 5 | + |
| 6 | +## Bug reports |
| 7 | + |
| 8 | +If you find a bug or a documentation issue, please report it or even better: fix it :). If you |
| 9 | +report it, please be as precise as possible. Here is a little list of required information: |
| 10 | + |
| 11 | + - Precise description of the bug |
| 12 | + - Details of your environment (for example: OS, PHP version, installed extensions) |
| 13 | + - Backtrace which might help identifing the bug |
| 14 | + |
| 15 | + |
| 16 | +## Security issues |
| 17 | + |
| 18 | +If you discover any security related issues, please contact us at |
| 19 | +[security@php-http.org](mailto:security@php-http.org) instead of submitting an issue on Github. |
| 20 | +This allows us to fix the issue and release a security hotfix without publicly disclosing the |
| 21 | +vulnerability. |
| 22 | + |
| 23 | + |
| 24 | +## Feature requests |
| 25 | + |
| 26 | +If you think a feature is missing, please report it or even better: implement it :). If you report |
| 27 | +it, describe the more precisely what you would like to see implemented and we will discuss what is |
| 28 | +the best approach for it. If you can do some research before submitting it and link the resources |
| 29 | +to your description, you're awesome! It will allow us to more easily understood/implement it. |
| 30 | + |
| 31 | + |
| 32 | +## Sending a Pull Request |
| 33 | + |
| 34 | +If you're here, you are going to fix a bug or implement a feature and you're the best! To do it, |
| 35 | +first fork the repository, clone it and create a new branch with the following commands: |
| 36 | + |
| 37 | +``` bash |
| 38 | +$ git clone git@github.com:your-name/repo-name.git |
| 39 | +$ git checkout -b feature-or-bug-fix-description |
| 40 | +``` |
| 41 | + |
| 42 | +Then install the dependencies through [Composer](https://getcomposer.org/): |
| 43 | + |
| 44 | +``` bash |
| 45 | +$ composer install |
| 46 | +``` |
| 47 | + |
| 48 | +Write code and tests. When you are ready, run the tests. |
| 49 | +(This is usually [PHPUnit](http://phpunit.de/) or [PHPSpec](http://phpspec.net/)) |
| 50 | + |
| 51 | +``` bash |
| 52 | +$ composer test |
| 53 | +``` |
| 54 | + |
| 55 | +When you are ready with the code, tested it and documented it, you can commit and push it with the |
| 56 | +following commands: |
| 57 | + |
| 58 | +``` bash |
| 59 | +$ git commit -m "Feature or bug fix description" |
| 60 | +$ git push origin feature-or-bug-fix-description |
| 61 | +``` |
| 62 | + |
| 63 | +**Note:** Please write your commit messages in the imperative and follow the |
| 64 | +[guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for clear and |
| 65 | +concise messages. |
| 66 | + |
| 67 | +Then [create a pull request](https://help.github.com/articles/creating-a-pull-request/) on GitHub. |
| 68 | + |
| 69 | +Please make sure that each individual commit in your pull request is meaningful. If you had to make |
| 70 | +multiple intermediate commits while developing, please squash them before submitting with the |
| 71 | +following commands (here, we assume you would like to squash 3 commits in a single one): |
| 72 | + |
| 73 | +``` bash |
| 74 | +$ git rebase -i HEAD~3 |
| 75 | +``` |
| 76 | + |
| 77 | +If your branch conflicts with the master branch, you will need to rebase and repush it with the |
| 78 | +following commands: |
| 79 | + |
| 80 | +``` bash |
| 81 | +$ git remote add upstream git@github.com:php-http/repo-name.git |
| 82 | +$ git pull --rebase upstream master |
| 83 | +$ git push -f origin feature-or-bug-fix-description |
| 84 | +``` |
| 85 | + |
| 86 | + |
| 87 | +## Coding standard |
| 88 | + |
| 89 | +This repository follows the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) and so, if you want |
| 90 | +to contribute, you must follow these rules. |
| 91 | + |
| 92 | + |
| 93 | +## Semver |
| 94 | + |
| 95 | +We are trying to follow [semver](http://semver.org/). When you are making BC breaking changes, |
| 96 | +please let us know why you think it is important. In this case, your patch can only be included in |
| 97 | +the next major version. |
0 commit comments