Skip to content
Permalink
Browse files

Fix #2349 - use function suppressed issues

  • Loading branch information
muglug committed Dec 31, 2019
1 parent f79088a commit d7fb64bbb7f95bf7dc4992d082da1b0be7987950
Showing with 18 additions and 2 deletions.
  1. +2 −2 src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php
  2. +16 −0 tests/ReturnTypeTest.php
@@ -173,7 +173,7 @@ public static function verifyReturnType(
. $return_type . ' expected',
$return_type_location
),
$source->getSuppressedIssues()
$suppressed_issues
)) {
return false;
}
@@ -198,7 +198,7 @@ public static function verifyReturnType(
. 'either implicitly or explicitly',
$return_type_location
),
$source->getSuppressedIssues()
$suppressed_issues
)) {
return false;
}
@@ -683,6 +683,22 @@ public function foo() {
}
}',
],
'suppressNeverReturnTypeInClass' => [
'<?php
function may_exit() : void {
exit(0);
}
class InClass {
/**
* @psalm-suppress InvalidReturnType
* @psalm-return never-returns
*/
function test() {
may_exit();
}
}',
],
];
}

0 comments on commit d7fb64b

Please sign in to comment.
You can’t perform that action at this time.