From 8ad6a50df2d743d33154b99d77177914bafbc0a5 Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Wed, 9 Feb 2022 15:22:33 +0100 Subject: [PATCH] test(phpstan): Ignore a false unreachable statement error --- .github/workflows/testing.yml | 2 +- phpstan.neon | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 466b61471..99c4f9c63 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -89,7 +89,7 @@ jobs: webonyx/graphql-php:^14.8 \ drupal/typed_data:^1.0 \ drupal/redirect:^1.6 \ - phpstan/phpstan:^1.2.0 \ + phpstan/phpstan:^1.4.6 \ mglaman/phpstan-drupal:^1.1.2 \ phpstan/phpstan-deprecation-rules:^1.0.0 \ jangregor/phpstan-prophecy:^1.0.0 \ diff --git a/phpstan.neon b/phpstan.neon index 4b3befe79..313f31e16 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -22,6 +22,11 @@ parameters: # yet, disable for now. checkGenericClassInNonGenericObjectType: false ignoreErrors: + # PHPStan bug, ignore for now. + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/Entity/Server.php # @todo Ignore phpstan-drupal extension's rules for now, activate later. - '#\Drupal calls should be avoided in classes, use dependency injection instead#' # new static() is a best practice in Drupal, so we cannot fix that.