From 19ed58cc1fcc68500fced1d1642fc5e99cae688b Mon Sep 17 00:00:00 2001 From: Lee <8024370+millnut@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:44:44 +0100 Subject: [PATCH] ci: fix phpstan (#36) * ci: fix phpstan * ci: fix phpstan - ignore new static() * ci: use same phpstan config as main project * Trying to re-run tests. --------- Co-authored-by: ekes --- phpstan.neon | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 8168a38..aa98928 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,9 +1,13 @@ 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.#' + # 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. + 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.#' + # new static() is a best practice in Drupal, so we cannot fix that. + - '#^Unsafe usage of new static#'