2016-07-26 19:57:15 +00:00
# Contributing to PHP-ML
PHP-ML is an open source project. If you'd like to contribute, please read the following text. Before I can merge your
Pull-Request here are some guidelines that you need to follow. These guidelines exist not to annoy you, but to keep the
code base clean, unified and future proof.
## Branch
2018-01-06 12:09:33 +00:00
You should only open pull requests against the `master` branch.
2016-07-26 19:57:15 +00:00
2018-03-10 20:48:16 +00:00
## Unit Tests
2016-07-26 19:57:15 +00:00
Please try to add a test for your pull-request. You can run the unit-tests by calling:
2018-01-06 12:09:33 +00:00
```bash
vendor/bin/phpunit
2016-07-26 19:57:15 +00:00
```
2018-03-10 20:48:16 +00:00
## Performance Tests
Before first run bootstrap script will download all necessary datasets from public repository `php-ai/php-ml-datasets` .
Time performance tests:
```bash
vendor/bin/phpbench run --report=time
```
Memory performance tests:
```bash
vendor/bin/phpbench run --report=memory
```
2016-07-26 19:57:15 +00:00
## Travis
2018-01-06 12:09:33 +00:00
GitHub automatically run your pull request through Travis CI.
If you break the tests, I cannot merge your code, so please make sure that your code is working before opening up a Pull-Request.
2016-07-26 19:57:15 +00:00
## Merge
2018-03-10 20:48:16 +00:00
Please give me time to review your pull requests. I will give my best to review everything as fast as possible, but cannot always live up to my own expectations.
2016-07-26 19:57:15 +00:00
2018-01-06 12:09:33 +00:00
## Coding Standards & Static Analysis
When contributing code to PHP-ML, you must follow its coding standards. To do that, just run:
```bash
2018-03-10 20:48:16 +00:00
composer fix-cs
2018-01-06 12:09:33 +00:00
```
[More about EasyCodingStandard ](https://github.com/Symplify/EasyCodingStandard )
Code has to also pass static analysis by [PHPStan ](https://github.com/phpstan/phpstan ):
2016-07-26 19:57:15 +00:00
2018-01-06 12:09:33 +00:00
```bash
2018-03-10 20:48:16 +00:00
composer phpstan
2018-01-06 12:09:33 +00:00
```
2016-07-26 19:57:15 +00:00
2017-02-01 12:52:36 +00:00
## Documentation
Please update the documentation pages if necessary. You can find them in docs/.
2016-07-26 19:57:15 +00:00
---
Thank you very much again for your contribution!