-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ To install this package using Composer, follow these steps: | |
|
||
## Usage | ||
|
||
Simple example: | ||
```php | ||
Check failure on line 33 in README.md
|
||
<?php | ||
|
||
|
@@ -45,10 +46,34 @@ $finder = Finder::create() | |
->exclude('build') | ||
; | ||
|
||
return \Yard\PhpCsFixerRules\Config::setFinder($finder) | ||
->mergeRules([ // allows you to add new rules or override rules from default | ||
'declare_strict_types' => false, | ||
return \Yard\PhpCsFixerRules\Config::create($finder); | ||
``` | ||
|
||
More complex: | ||
```php | ||
Check failure on line 53 in README.md
|
||
<?php | ||
|
||
use PhpCsFixer\Finder; | ||
|
||
$finder = Finder::create() | ||
->in(__DIR__) | ||
->name('*.php') | ||
->notName('*.blade.php') | ||
->ignoreDotFiles(true) | ||
->ignoreVCS(true) | ||
->exclude('public') | ||
->exclude('node_modules') | ||
->exclude('build') | ||
; | ||
|
||
return \Yard\PhpCsFixerRules\Config::create($finder) | ||
->mergeRules([ | ||
Check failure on line 70 in README.md
|
||
'yoda_style' => [ | ||
Check failure on line 71 in README.md
|
||
'equal' => false, | ||
Check failure on line 72 in README.md
|
||
], | ||
Check failure on line 73 in README.md
|
||
]) | ||
Check failure on line 74 in README.md
|
||
->setRiskyAllowed(false) // override and disable risky setting for old projects | ||
->get(); | ||
->removeRule('declare_strict_types') | ||
Check failure on line 75 in README.md
|
||
->removeRules(['no_unused_imports', 'trailing_comma_in_multiline']) | ||
Check failure on line 76 in README.md
|
||
->setRiskyAllowed(false); // disable this for old sites! | ||
Check failure on line 77 in README.md
|
||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<?php | ||
|
||
declare(strict_types=1); |