11# Contributing
22
3+ If you contribute code, please make sure it conforms to the
4+ [ PHPCS coding standard] ( https://github.com/squizlabs/PHP_CodeSniffer/blob/master/phpcs.xml.dist )
5+ and that the unit tests still pass.
6+
37## Setup
48
59We do recommend the following setup:
@@ -12,17 +16,42 @@ We do recommend the following setup:
1216* install all required dependencies
1317
1418 composer install
19+
20+ * be sure that [ Xdebug] ( https://xdebug.org/ ) is installed, if you like to check code coverage.
21+
22+
23+ ## Coding Standard
24+
25+ To check the coding standard, execute in the repository root:
26+
27+ ./vendor/bin/phpcs
28+
29+ ` phpcs ` might report that some coding standard issues can be fixed automatically.
30+ So give ` phpcbf ` a try and let it fix the issues for you:
31+
32+ ./vendor/bin/phpcbf
33+
34+ ## Tests
35+
36+ To run the unit tests, execute in the repository root:
37+
38+ ./vendor/bin/phpunit
39+
40+ ## Code Coverage
41+
42+ Make sure, that you write tests for your code.
1543
44+ Testing code coverage with [ PHPUnit] ( https://phpunit.de/ ) requires [ Xdebug] ( https://xdebug.org/ ) to be enabled.
1645
17- ## Coding Standard and Tests
46+ You can generate a simple code coverage report by running in the repository root:
1847
19- If you contribute code, please make sure it conforms to the PHPCS coding standard and that the unit tests still pass.
48+ ./vendor/bin/phpunit --coverage-text
2049
21- 1 . To check the coding standard, execute in the repository root:
50+ In the case that Xdebug is disabled by default
2251
23- ./ vendor/bin/phpcs
52+ php -d zend_extension=xdebug.so vendor/bin/phpunit --coverage-text
2453
25- 2 . To run the unit tests, execute in the repository root:
54+ will do the trick.
2655
27- ./vendor/bin/ phpunit --filter MO4
56+ Please refer to the [ PHPUnit Manual ] ( https:// phpunit.de/documentation.html ) for further information about code coverage.
2857
0 commit comments