From 596ee11d0dd0f0bc60fc2f03d06b3841021b2e99 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 21 Oct 2023 20:48:06 +0200 Subject: [PATCH] cs-fix --- .../Statements/Expression/BinaryOp/ConcatAnalyzer.php | 2 +- src/Psalm/Internal/LanguageServer/LanguageServer.php | 2 +- src/Psalm/Internal/Type/TypeParser.php | 6 +++++- src/Psalm/Report/CountReport.php | 2 +- src/Psalm/Storage/FunctionLikeStorage.php | 2 +- src/Psalm/Type/Atomic/TValueOf.php | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php index c9dcbafdb..05bfb3fc3 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php @@ -180,7 +180,7 @@ class ConcatAnalyzer if ($literal_concat) { // Bypass opcache bug: https://github.com/php/php-src/issues/10635 - (static function (int $_) : void { + (static function (int $_): void { })($combinations); if (count($result_type_parts) === 0) { throw new AssertionError("The number of parts cannot be 0!"); diff --git a/src/Psalm/Internal/LanguageServer/LanguageServer.php b/src/Psalm/Internal/LanguageServer/LanguageServer.php index 48c0de835..fde6b5413 100644 --- a/src/Psalm/Internal/LanguageServer/LanguageServer.php +++ b/src/Psalm/Internal/LanguageServer/LanguageServer.php @@ -237,7 +237,7 @@ class LanguageServer extends Dispatcher $this->protocolReader->on( 'readMessageGroup', - static function () : void { + static function (): void { //$this->verboseLog('Received message group'); //$this->doAnalysis(); }, diff --git a/src/Psalm/Internal/Type/TypeParser.php b/src/Psalm/Internal/Type/TypeParser.php index fc66827c8..0287ab4d6 100644 --- a/src/Psalm/Internal/Type/TypeParser.php +++ b/src/Psalm/Internal/Type/TypeParser.php @@ -958,7 +958,11 @@ class TypeParser } assert(count($parse_tree->children) === 2); - $get_int_range_bound = static function (ParseTree $parse_tree, Union $generic_param, string $bound_name) : ?int { + $get_int_range_bound = static function ( + ParseTree $parse_tree, + Union $generic_param, + string $bound_name + ): ?int { if (!$parse_tree instanceof Value || count($generic_param->getAtomicTypes()) > 1 || (!$generic_param->getSingleAtomic() instanceof TLiteralInt diff --git a/src/Psalm/Report/CountReport.php b/src/Psalm/Report/CountReport.php index f4f3c4287..4321789d4 100644 --- a/src/Psalm/Report/CountReport.php +++ b/src/Psalm/Report/CountReport.php @@ -21,7 +21,7 @@ class CountReport extends Report $issue_type_counts[$issue_data->type] = 1; } } - uksort($issue_type_counts, static function (string $a, string $b) use ($issue_type_counts) : int { + uksort($issue_type_counts, static function (string $a, string $b) use ($issue_type_counts): int { $cmp_result = $issue_type_counts[$a] <=> $issue_type_counts[$b]; if ($cmp_result === 0) { return $a <=> $b; diff --git a/src/Psalm/Storage/FunctionLikeStorage.php b/src/Psalm/Storage/FunctionLikeStorage.php index 33bff92dd..7be91f804 100644 --- a/src/Psalm/Storage/FunctionLikeStorage.php +++ b/src/Psalm/Storage/FunctionLikeStorage.php @@ -254,7 +254,7 @@ abstract class FunctionLikeStorage implements HasAttributesInterface $params = count($this->params) > 0 ? "\n" . implode( ",\n", array_map( - static function (FunctionLikeParameter $param) : string { + static function (FunctionLikeParameter $param): string { $realType = $param->type ?: 'mixed'; return " {$realType} \${$param->name}"; }, diff --git a/src/Psalm/Type/Atomic/TValueOf.php b/src/Psalm/Type/Atomic/TValueOf.php index a202c12e1..59941bc61 100644 --- a/src/Psalm/Type/Atomic/TValueOf.php +++ b/src/Psalm/Type/Atomic/TValueOf.php @@ -42,7 +42,7 @@ final class TValueOf extends Atomic } return new Union(array_map( - static function (EnumCaseStorage $case) : Atomic { + static function (EnumCaseStorage $case): Atomic { assert($case->value !== null); // Backed enum must have a value return ConstantTypeResolver::getLiteralTypeFromScalarValue($case->value);