Skip to content

Commit b00ceb1

Browse files
committed
Document coding standard in CONTRIBUTING.md
1 parent 61e5ddf commit b00ceb1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,31 @@ test suite. In addition to various PHPUnit options, it defines required
3535
this configuration by creating your own `phpunit.xml` file based on the
3636
`phpunit.xml.dist` file we provide.
3737

38+
## Checking coding standards
39+
40+
The library's code is checked using [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer),
41+
which is installed as a development dependency by Composer. Due to the PHP
42+
requirement, the base version of the coding standard is not installed and needs
43+
to be added manually if you plan to contributing code:
44+
45+
```
46+
$ composer require --dev doctrine/coding-standard=^6.0
47+
```
48+
49+
Once the coding standard has been installed, you can check the code for style
50+
errors:
51+
52+
53+
```
54+
$ vendor/bin/phpcs
55+
```
56+
57+
To automatically fix all fixable errors, use the `phpcbf` binary:
58+
59+
```
60+
$ vendor/bin/phpcbf
61+
```
62+
3863
## Documentation
3964

4065
Documentation for the library lives in the `docs/` directory and is built with

0 commit comments

Comments
 (0)