1
1
# Contributing
2
2
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
+
3
7
## Setup
4
8
5
9
We do recommend the following setup:
@@ -12,17 +16,42 @@ We do recommend the following setup:
12
16
* install all required dependencies
13
17
14
18
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.
15
43
44
+ Testing code coverage with [ PHPUnit] ( https://phpunit.de/ ) requires [ Xdebug] ( https://xdebug.org/ ) to be enabled.
16
45
17
- ## Coding Standard and Tests
46
+ You can generate a simple code coverage report by running in the repository root:
18
47
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
20
49
21
- 1 . To check the coding standard, execute in the repository root:
50
+ In the case that Xdebug is disabled by default
22
51
23
- ./ vendor/bin/phpcs
52
+ php -d zend_extension=xdebug.so vendor/bin/phpunit --coverage-text
24
53
25
- 2 . To run the unit tests, execute in the repository root:
54
+ will do the trick.
26
55
27
- ./vendor/bin/ phpunit --filter MO4
56
+ Please refer to the [ PHPUnit Manual ] ( https:// phpunit.de/documentation.html ) for further information about code coverage.
28
57
0 commit comments