|
| 1 | +# Contributing |
| 2 | + |
| 3 | +All contributions are **welcome** and **very much appreciated**. |
| 4 | + |
| 5 | +We accept contributions via Pull Requests on [Github](https://github.com/trikoder/oauth2-bundle). |
| 6 | + |
| 7 | +## Pull Request guidelines |
| 8 | + |
| 9 | +- **Add tests!** - We strongly encourage adding tests as well since the PR might not be accepted without them. |
| 10 | + |
| 11 | +- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. |
| 12 | + |
| 13 | +- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. |
| 14 | + |
| 15 | +- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. |
| 16 | + |
| 17 | +## Development |
| 18 | + |
| 19 | +[Docker](https://www.docker.com/) 18.03+ and [Docker Compose](https://github.com/docker/compose) 1.13+ are required for the development environment. |
| 20 | + |
| 21 | +### Building the environment |
| 22 | + |
| 23 | +Make sure your Docker images are all built and up-to-date using the following command: |
| 24 | + |
| 25 | +```sh |
| 26 | +dev/bin/docker-compose build |
| 27 | +``` |
| 28 | + |
| 29 | +> **NOTE:** You can target a different version of PHP during development by appending the `--build-arg PHP_VERSION=<version>` argument. |
| 30 | +
|
| 31 | +After that, install all the needed packages required to develop the project: |
| 32 | + |
| 33 | +```sh |
| 34 | +dev/bin/php composer install |
| 35 | +``` |
| 36 | + |
| 37 | +### Debugging |
| 38 | + |
| 39 | +You can run the debugger using the following command: |
| 40 | + |
| 41 | +```sh |
| 42 | +dev/bin/php-debug vendor/bin/phpunit |
| 43 | +``` |
| 44 | + |
| 45 | +Make sure your IDE is setup properly, for more information check out the [dedicated documentation](docs/debugging.md). |
| 46 | + |
| 47 | +### Code linting |
| 48 | + |
| 49 | +This bundle enforces the PSR-2 and Symfony code standards during development by using the [PHP CS Fixer](https://cs.sensiolabs.org/) utility. Before committing any code, you can run the utility to fix any potential rule violations: |
| 50 | + |
| 51 | +```sh |
| 52 | +dev/bin/php composer lint |
| 53 | +``` |
| 54 | + |
| 55 | +### Testing |
| 56 | + |
| 57 | +You can run the whole test suite using the following command: |
| 58 | + |
| 59 | +```sh |
| 60 | +dev/bin/php-test composer test |
| 61 | +``` |
| 62 | + |
| 63 | +**Happy coding**! |
0 commit comments