Skip to content

Commit 2b70ca2

Browse files
authored
Merge pull request #25 from BedrockStreaming/docs/explain-hox-to-exted-the-config-on-the-project-side
2 parents 72708c4 + ac3771d commit 2b70ca2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,43 @@ $config->setFinder($finder);
3333
return $config;
3434
```
3535

36+
### Custom configuration
37+
38+
You may extend these rules and apply your own extra rules.
39+
40+
Create a configuration file `.php-cs-fixer.dist.php` in the root of your project:
41+
42+
```php
43+
<?php
44+
45+
$finder = PhpCsFixer\Finder::create()
46+
->in([
47+
__DIR__.'/src',
48+
__DIR__.'/tests',
49+
]);
50+
51+
$config = new class() extends PhpCsFixer\Config {
52+
public function __construct()
53+
{
54+
parent::__construct('customized Bedrock Streaming');
55+
$this->setRiskyAllowed(true);
56+
}
57+
58+
public function getRules(): array
59+
{
60+
$rules = (new M6Web\CS\Config\BedrockStreaming())->getRules();
61+
62+
// perform updates on the rules array here
63+
64+
return $rules;
65+
}
66+
};
67+
68+
$config->setFinder($finder);
69+
70+
return $config;
71+
```
72+
3673
### Git
3774

3875
Add `.php-cs-fixer.cache` (this is the cache file created by `php-cs-fixer`) to `.gitignore`:

0 commit comments

Comments
 (0)