Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes authored Aug 23, 2022
1 parent f120c3b commit 8019e79
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,34 +79,15 @@ parameters:

If you don't want to start using all the available strict rules at once but only one or two, you can!

### Without extension-installer

Just don't include the whole `rules.neon` from this package in your configuration, but look at its contents and copy only the rules you want to your configuration under the `services` key:

```neon
services:
-
class: PHPStan\Rules\StrictCalls\StrictFunctionCallsRule
tags:
- phpstan.rules.rule
-
class: PHPStan\Rules\SwitchConditions\MatchingTypeInSwitchCaseConditionRule
tags:
- phpstan.rules.rule
```

### With extension-installer

When using `phpstan/extension-installer` you can disable automatic loading of all rules by:
You can disable all rules from the included `rules.neon` with:

```neon
parameters:
strictRules:
allRules: false
```

Then you can enable individual rules by adding them as services just like without extension-installer (see above) or re-enable them by configuration parameters:
Then you can re-enable individual rules with configuration parameters:

```neon
parameters:
Expand Down

0 comments on commit 8019e79

Please sign in to comment.