Skip to content

Commit a6335f4

Browse files
author
Feyyaz Esatoglu
committed
APM-541 fixes requested by @dmvdbrugge
1 parent 4e83227 commit a6335f4

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
Contains PHP coding standards like rules for PHP-CS-Fixer that serves for purpose of standardization.
33

44
## Usage
5+
This package makes use of PHP-CS-Fixer.
6+
7+
### Already familiar with PHP-CS-Fixer
8+
9+
This package provides default rules to be used with PHP-CS-Fixer.
10+
11+
You can find them in `Mollie\PhpCodingStandards\PhpCsFixer\Rules` which has methods specific to php version,
12+
which you can directly use in the `->setRules()` part of your config. For example, assuming PHP version 7.3:
13+
14+
```php
15+
use Mollie\PhpCodingStandards\PhpCsFixer\Rules;
16+
17+
$config->setRules(Rules::getForPhp73());
18+
```
19+
20+
### New to PHP-CS-Fixer
21+
522
Place a file named `.php_cs.dist` that has following content in your project's root directory.
623

724
```php
@@ -18,8 +35,8 @@ return Config::create()
1835
->setRiskyAllowed(true)
1936
// use specific rules for your php version e.g.: getForPhp71, getForPhp72, getForPhp73
2037
->setRules(Rules::getForPhp71());
21-
2238
```
39+
2340
### Manual Triggering
2441
Run following command in your project directory, that will run fixer for every `.php` file.
2542
```bash

0 commit comments

Comments
 (0)