Skip to content

Commit eaa4f86

Browse files
authored
test(phpstan): Ignore PHPStan warning directly in code with a comment (#1263)
1 parent 6bf0fc2 commit eaa4f86

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

phpstan.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ parameters:
2222
# yet, disable for now.
2323
checkGenericClassInNonGenericObjectType: false
2424
ignoreErrors:
25-
# PHPStan bug, ignore for now.
26-
-
27-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
28-
count: 1
29-
path: src/Entity/Server.php
3025
# @todo Ignore phpstan-drupal extension's rules for now, activate later.
3126
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
3227
# new static() is a best practice in Drupal, so we cannot fix that.

src/Entity/Server.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,9 @@ protected function getValidationRules() {
526526
return [];
527527
}
528528

529+
// PHPStan thinks this is unreachable code because of the wrongly
530+
// documented $params->queryId.
531+
// @phpstan-ignore-next-line
529532
$rules = array_values(DocumentValidator::defaultRules());
530533
if ($this->getDisableIntrospection()) {
531534
$rules[] = new DisableIntrospection();

0 commit comments

Comments
 (0)