From 2bfdf9bc68d49b5653084382e571ebdae0ee2de1 Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Wed, 4 Jan 2023 01:00:31 +0100 Subject: [PATCH] code style --- .../Analyzer/FunctionLike/ReturnTypeAnalyzer.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php b/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php index 21a48c7a1..5cfd1b176 100644 --- a/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php @@ -215,7 +215,6 @@ class ReturnTypeAnalyzer return null; } - if ($return_type && $return_type->isNever() && !$inferred_yield_types @@ -265,6 +264,7 @@ class ReturnTypeAnalyzer /** * see https://github.com/vimeo/psalm/issues/9045 + * * @psalm-suppress InvalidArgument */ $inferred_return_type_with_never = Type::combineUnionTypeArray( @@ -451,10 +451,10 @@ class ReturnTypeAnalyzer || ($classlike_storage && $classlike_storage->final), ); - if ( - ( - !$inferred_return_type_parts - || ($inferred_return_type->isVoid() && $function_returns_implicitly && count($inferred_return_type_parts) === 1) + if ((!$inferred_return_type_parts + || ($inferred_return_type->isVoid() + && $function_returns_implicitly + && count($inferred_return_type_parts) === 1) ) && !$inferred_return_type->isNever() && !$inferred_yield_types