CONTRIBUTING.md 1.67 KB
Newer Older
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
1 2 3 4 5 6 7 8
# 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

9
You should only open pull requests against the `master` branch.
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
10

11
## Unit Tests
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
12 13 14

Please try to add a test for your pull-request. You can run the unit-tests by calling:

15 16
```bash
vendor/bin/phpunit
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
17 18
```

19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
## 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
```

Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
35 36
## Travis

37 38
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.
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
39 40 41

## Merge

42
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.
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
43

44 45 46 47 48
## Coding Standards & Static Analysis

When contributing code to PHP-ML, you must follow its coding standards. To do that, just run:

```bash
49
composer fix-cs
50 51 52 53
```
[More about EasyCodingStandard](https://github.com/Symplify/EasyCodingStandard)

Code has to also pass static analysis by [PHPStan](https://github.com/phpstan/phpstan):
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
54

55
```bash
56
composer phpstan
57
```
Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
58 59


60 61 62 63
## Documentation

Please update the documentation pages if necessary. You can find them in docs/.

Arkadiusz Kondas's avatar
Arkadiusz Kondas committed
64 65 66
---

Thank you very much again for your contribution!