|
| 1 | +# Contribute to modlr |
| 2 | + |
| 3 | +Thank you for contributing to the modlr project! |
| 4 | + |
| 5 | +Before we can merge your Pull-Request here are some guidelines that you need to follow. |
| 6 | +These guidelines exist not to annoy you, but to keep the code base clean, |
| 7 | +unified and future proof. |
| 8 | + |
| 9 | +## We only accept PRs to "master" |
| 10 | + |
| 11 | +Our branching strategy is "everything to master first", even |
| 12 | +bugfixes and we then merge them into the stable branches. You should only |
| 13 | +open pull requests against the master branch. Otherwise we cannot accept the PR. |
| 14 | + |
| 15 | +There is one exception to the rule, when we merged a bug into some stable branches |
| 16 | +we do occasionally accept pull requests that merge the same bug fix into earlier |
| 17 | +branches. |
| 18 | + |
| 19 | +## Coding Standard |
| 20 | + |
| 21 | +We use PSR-1 and PSR-2: |
| 22 | + |
| 23 | +* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md |
| 24 | +* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md |
| 25 | + |
| 26 | +with some exceptions/differences: |
| 27 | + |
| 28 | +* Keep the nesting of control structures per method as small as possible |
| 29 | +* Align equals (=) signs |
| 30 | +* Add spaces between assignment, control and return statements |
| 31 | +* Prefer early exit over nesting conditions |
| 32 | +* Add legal information at the beginning of each source file |
| 33 | + |
| 34 | +## Unit-Tests |
| 35 | + |
| 36 | +Please try to add a test for your pull-request. |
| 37 | + |
| 38 | +* If you want to contribute new functionality add unit- or functional tests |
| 39 | + depending on the scope of the feature. |
| 40 | + |
| 41 | +You can run the unit-tests by calling ``bin/phpunit`` from the root of the project. |
| 42 | +It will run all the project tests. |
| 43 | + |
| 44 | +In order to do that, you will have to run a composer installation in the project: |
| 45 | + |
| 46 | +```sh |
| 47 | +curl -sS https://getcomposer.org/installer | php -- |
| 48 | +./composer.phar install |
| 49 | +``` |
| 50 | + |
| 51 | +## Travis |
| 52 | + |
| 53 | +We automatically run your pull request through [Travis CI](https://www.travis-ci.org) |
| 54 | +against supported PHP versions. If you break the tests, we cannot merge your code, |
| 55 | +so please make sure that your code is working after opening up a Pull-Request. |
| 56 | + |
| 57 | +## Scrutinizer |
| 58 | + |
| 59 | +We automatically run your pull request through [Scrutinizer](https://scrutinizer-ci.com) |
| 60 | +to ensure code quality. Please make sure you address any concerns reported by scrutinizer. |
| 61 | + |
| 62 | +## Getting merged |
| 63 | + |
| 64 | +Please allow us time to review your pull requests. We will give our best to review |
| 65 | +everything as fast as possible, but cannot always live up to our own expectations. |
| 66 | + |
| 67 | +Thank you very much again for your contribution! |
0 commit comments