@@ -30,14 +30,29 @@ publicly**. We will disclose details of the issue and credit you after having re
3030First of all, you must decide on what branch your changes will be based depending of the nature of the change.
3131See [ the dedicated documentation entry] ( https://api-platform.com/docs/extra/releases/ ) .
3232
33+ To prepare your patch directly in the ` vendor/ ` of an existing project (convenient to fix a bug):
34+
35+ 1 . Remove the existing copy of the library: ` rm -Rf vendor/api-platform/core `
36+ 2 . Reinstall the lib while keeping Git metadata: ` composer install --prefer-source `
37+ 3 . You can now work directly in ` vendor/api-platform/core ` , create a new branch: ` git checkout -b my_patch `
38+ 4 . When your patch is ready, fork the project and add your Git remote:
` git remote add <your-name> [email protected] :<your-name>/core.git ` 39+ 5 . You can now push your code and open your Pull Request: ` git push <your-name> my_patch `
40+
41+ Alternatively, you can also work with the test application we provide:
42+
43+ cd tests/Fixtures/app
44+ ./console assets:install --symlink
45+ symfony serve
46+
47+ # or if you prefer using the PHP built-in web server
48+ php -S localhost:8000 -t public/
49+
3350### Matching Coding Standards
3451
3552The API Platform project follows [ Symfony coding standards] ( https://symfony.com/doc/current/contributing/code/standards.html ) .
3653But don't worry, you can fix CS issues automatically using the [ PHP CS Fixer] ( http://cs.sensiolabs.org/ ) tool:
3754
38- ``` shell
39- php-cs-fixer.phar fix
40- ```
55+ php-cs-fixer.phar fix
4156
4257And then, add the fixed file to your commit before pushing.
4358Be sure to add only ** your modified files** . If any other file is fixed by cs tools, just revert it before committing.
@@ -66,45 +81,33 @@ Both `phpunit` and `behat` are development dependencies and should be available
6681
6782To launch unit tests:
6883
69- ``` shell
70- vendor/bin/phpunit --stop-on-failure -vvv
71- ```
84+ vendor/bin/phpunit --stop-on-failure -vvv
7285
73- If you want coverage, you will need the ` phpdbg ` package and run:
86+ If you want coverage, you will need the ` pcov ` PHP extension and run:
7487
75- ``` shell
76- phpdbg -qrr vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
77- ```
88+ vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
7889
7990Sometimes there might be an error with too many open files when generating coverage. To fix this, you can increase the ` ulimit ` , for example:
8091
81- ``` shell
82- ulimit -n 4000
83- ```
92+ ulimit -n 4000
8493
8594Coverage will be available in ` coverage/index.html ` .
8695
8796#### Behat
8897
8998The command to launch Behat tests is:
9099
91- ``` shell
92- ./vendor/bin/behat --suite=default --stop-on-failure -vvv
93- ```
100+ ./vendor/bin/behat --suite=default --stop-on-failure -vvv
94101
95102If you want to launch Behat tests for MongoDB, the command is:
96103
97- ``` shell
98- APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
99- ```
104+ APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
100105
101106## Squash your Commits
102107
103108If you have 3 commits, start with:
104109
105- ``` shell
106- git rebase -i HEAD~3
107- ```
110+ git rebase -i HEAD~3
108111
109112An editor will be opened with your 3 commits, all prefixed by ` pick ` .
110113
@@ -116,15 +119,11 @@ After that, all your commits will be squashed into the first one and the commit
116119
117120If you would like to rename your commit message, type:
118121
119- ``` shell
120- git commit --amend
121- ```
122+ git commit --amend
122123
123124Now force push to update your PR:
124125
125- ``` shell
126- git push --force-with-lease
127- ```
126+ git push --force-with-lease
128127
129128# License and Copyright Attribution
130129
@@ -134,3 +133,13 @@ and to transfer the copyright on the submitted code to Kévin Dunglas.
134133Be sure to you have the right to do that (if you are a professional, ask your company)!
135134
136135If you include code from another project, please mention it in the Pull Request description and credit the original author.
136+
137+ # Releases
138+
139+ This section is dedicated to maintainers.
140+
141+ 1 . Update the JavaScript dependencies by running ` ./update-js.sh ` (always check if it works in a browser)
142+ 2 . Update the ` CHANGELOG.md ` file (be sure to include Pull Request numbers when appropriate)
143+ 3 . Create a signed tag: ` git tag -s vX.Y.Z -m "Version X.Y.Z" `
144+ 4 . Create a release using GitHub's UI and copy the changelog
145+ 5 . Create a new release of ` api-platform/api-platform `
0 commit comments