From f0e8937431c1c294716b95445e95bf61b24345e4 Mon Sep 17 00:00:00 2001 From: Lee Mills <8024370+millnut@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:11:23 +0100 Subject: [PATCH 1/4] ci: fix phpstan --- phpstan.neon | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 8168a38..5450422 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,9 +1,10 @@ parameters: - customRulesetUsed: true - reportUnmatchedIgnoredErrors: false - # Ignore phpstan-drupal extension's rules. - ignoreErrors: - - '#\Drupal calls should be avoided in classes, use dependency injection instead#' - - '#Plugin definitions cannot be altered.#' - - '#Missing cache backend declaration for performance.#' - - '#Plugin manager has cache backend specified but does not declare cache tags.#' + level: 1 + customRulesetUsed: true + reportUnmatchedIgnoredErrors: false + # Ignore phpstan-drupal extension's rules. + ignoreErrors: + - '#\Drupal calls should be avoided in classes, use dependency injection instead#' + - '#Plugin definitions cannot be altered.#' + - '#Missing cache backend declaration for performance.#' + - '#Plugin manager has cache backend specified but does not declare cache tags.#' From a2b37072015742735128b8e6a2b80dc333f6bd0e Mon Sep 17 00:00:00 2001 From: Lee Mills <8024370+millnut@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:39:08 +0100 Subject: [PATCH 2/4] ci: fix phpstan - ignore new static() --- phpstan.neon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index 5450422..15d821d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -8,3 +8,5 @@ parameters: - '#Plugin definitions cannot be altered.#' - '#Missing cache backend declaration for performance.#' - '#Plugin manager has cache backend specified but does not declare cache tags.#' + # new static() is a best practice in Drupal, so we cannot fix that. + - '#^Unsafe usage of new static#' From 480dda307a7cf0af6a7e1d1cad4858b2bfbdb488 Mon Sep 17 00:00:00 2001 From: Lee Mills <8024370+millnut@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:34:05 +0100 Subject: [PATCH 3/4] ci: use same phpstan config as main project --- phpstan.neon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index 15d821d..e21ac3c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ parameters: - level: 1 + # we don't set a level so that we check deprecations only, and + # not to highlight unknown classes which are from composer suggestions customRulesetUsed: true reportUnmatchedIgnoredErrors: false # Ignore phpstan-drupal extension's rules. From fa1258d941ba2de7a8ce0c404c5e70b7078b2c09 Mon Sep 17 00:00:00 2001 From: ekes Date: Tue, 23 Apr 2024 11:52:40 +0200 Subject: [PATCH 4/4] Trying to re-run tests. --- phpstan.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index e21ac3c..aa98928 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,6 @@ parameters: # we don't set a level so that we check deprecations only, and - # not to highlight unknown classes which are from composer suggestions + # not to highlight unknown classes which are from composer suggestions. customRulesetUsed: true reportUnmatchedIgnoredErrors: false # Ignore phpstan-drupal extension's rules.