Yaffs site version 1.1
[yaffs-website] / vendor / doctrine / collections / CONTRIBUTING.md
1 # Contribute to Doctrine
2
3 Thank you for contributing to Doctrine!
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 [doctrine coding standard](https://github.com/doctrine/coding-standard) which is 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 spaces around a negation if condition ``if ( ! $cond)``
33 * Add legal information at the beginning of each source file
34 * Add ``@author`` [phpDoc](https://www.phpdoc.org/docs/latest/references/phpdoc/tags/author.html) comment at DockBlock of class/interface/trait that you create.
35
36 ## Unit-Tests
37
38 Please try to add a test for your pull-request.
39
40 * If you want to contribute new functionality add unit- or functional tests
41   depending on the scope of the feature.
42
43 You can run the unit-tests by calling ``vendor/bin/phpunit`` from the root of the project.
44 It will run all the project tests.
45
46 In order to do that, you will need a fresh copy of doctrine/collections, and you
47 will have to run a composer installation in the project:
48
49 ```sh
50 git clone git@github.com:doctrine/collections.git
51 cd collections
52 curl -sS https://getcomposer.org/installer | php --
53 ./composer.phar install
54 ```
55
56 ## Travis
57
58 We automatically run your pull request through [Travis CI](https://www.travis-ci.org)
59 against supported PHP versions. If you break the tests, we cannot merge your code,
60 so please make sure that your code is working before opening up a Pull-Request.
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!