From f2d359fba0b1c42b5aa1a9fa6a31f2cc5ace415f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on=20Gersen?= Date: Mon, 13 Sep 2021 15:44:14 +0200 Subject: [PATCH] Add information on using `ignoreErrors` to use all but a few strict rules --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 61e9d6fe..2f78e10d 100644 --- a/README.md +++ b/README.md @@ -74,3 +74,15 @@ services: ``` *Unfortunately, you cannot use phpstan/extension-installer in this case.* + +### Enabling all but a few rules + +If you want to enable all but a few rules, or if you prefer to use the extension installer while you don't want to enable all strict rules, you can [ignore the errors](https://phpstan.org/user-guide/ignoring-errors#ignoring-in-configuration-file) from the rules you don't want to use: + +``` +parameters: + ignoreErrors: + - '#.*should be covariant.*#' + - '#.*should be contravariant.*#' + - '#Short ternary operator is not allowed.*#' +```