Chris@12: # Contribute to Doctrine Chris@12: Chris@12: Thank you for contributing to Doctrine! Chris@12: Chris@12: Before we can merge your Pull-Request here are some guidelines that you need to follow. Chris@12: These guidelines exist not to annoy you, but to keep the code base clean, Chris@12: unified and future proof. Chris@12: Chris@12: ## We only accept PRs to "master" Chris@12: Chris@12: Our branching strategy is "everything to master first", even Chris@12: bugfixes and we then merge them into the stable branches. You should only Chris@12: open pull requests against the master branch. Otherwise we cannot accept the PR. Chris@12: Chris@12: There is one exception to the rule, when we merged a bug into some stable branches Chris@12: we do occasionally accept pull requests that merge the same bug fix into earlier Chris@12: branches. Chris@12: Chris@12: ## Coding Standard Chris@12: Chris@12: We use [doctrine coding standard](https://github.com/doctrine/coding-standard) which is PSR-1 and PSR-2: Chris@12: Chris@12: * https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md Chris@12: * https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md Chris@12: Chris@12: with some exceptions/differences: Chris@12: Chris@12: * Keep the nesting of control structures per method as small as possible Chris@12: * Align equals (=) signs Chris@12: * Add spaces between assignment, control and return statements Chris@12: * Prefer early exit over nesting conditions Chris@12: * Add spaces around a negation if condition ``if ( ! $cond)`` Chris@12: * Add legal information at the beginning of each source file Chris@12: * Add ``@author`` [phpDoc](https://www.phpdoc.org/docs/latest/references/phpdoc/tags/author.html) comment at DockBlock of class/interface/trait that you create. Chris@12: Chris@12: ## Unit-Tests Chris@12: Chris@12: Please try to add a test for your pull-request. Chris@12: Chris@12: * If you want to contribute new functionality add unit- or functional tests Chris@12: depending on the scope of the feature. Chris@12: Chris@12: You can run the unit-tests by calling ``vendor/bin/phpunit`` from the root of the project. Chris@12: It will run all the project tests. Chris@12: Chris@12: In order to do that, you will need a fresh copy of doctrine/collections, and you Chris@12: will have to run a composer installation in the project: Chris@12: Chris@12: ```sh Chris@12: git clone git@github.com:doctrine/collections.git Chris@12: cd collections Chris@12: curl -sS https://getcomposer.org/installer | php -- Chris@12: ./composer.phar install Chris@12: ``` Chris@12: Chris@12: ## Travis Chris@12: Chris@12: We automatically run your pull request through [Travis CI](https://www.travis-ci.org) Chris@12: against supported PHP versions. If you break the tests, we cannot merge your code, Chris@12: so please make sure that your code is working before opening up a Pull-Request. Chris@12: Chris@12: ## Getting merged Chris@12: Chris@12: Please allow us time to review your pull requests. We will give our best to review Chris@12: everything as fast as possible, but cannot always live up to our own expectations. Chris@12: Chris@12: Thank you very much again for your contribution!