diff --git a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php index 8bd9884bd2a..fead38b71d0 100644 --- a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php @@ -946,7 +946,7 @@ public static function addContextProperties( $stmts, static fn($stmt): bool => $stmt instanceof PhpParser\Node\Stmt\Property && isset($stmt->props[0]->name->name) - && $stmt->props[0]->name->name === $property_name + && $stmt->props[0]->name->name === $property_name, ); $suppressed = []; diff --git a/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php b/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php index b752d9176ff..763bd3e2f01 100644 --- a/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php @@ -245,7 +245,7 @@ public static function verifyReturnType( if (count($inferred_return_type_parts) > 1) { $inferred_return_type_parts = array_filter( $inferred_return_type_parts, - static fn(Union $union_type): bool => !$union_type->isNever() + static fn(Union $union_type): bool => !$union_type->isNever(), ); } $inferred_return_type_parts = array_values($inferred_return_type_parts); diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php index fa1970e3ae6..c98700f071a 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php @@ -78,7 +78,7 @@ public static function analyze( $entry_clauses, static fn(Clause $c): bool => count($c->possibilities) > 1 || $c->wedge - || !isset($changed_var_ids[array_key_first($c->possibilities)]) + || !isset($changed_var_ids[array_key_first($c->possibilities)]), ), ); } diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php index 00c7895c2be..e1378100049 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php @@ -144,7 +144,7 @@ public static function analyze( $elseif_context_clauses = array_values( array_filter( $elseif_context_clauses, - static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true) + static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true), ), ); } diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php index b4648cd59f2..99ef6c45291 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php @@ -182,7 +182,7 @@ public static function analyze( $if_context->clauses = array_values( array_filter( $if_context->clauses, - static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses) + static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses), ), ); diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php index d721f481587..982cb4d78c7 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php @@ -105,7 +105,7 @@ public static function analyze( $context_clauses = array_values( array_filter( $context_clauses, - static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true) + static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true), ), ); diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php index 2a2e0cf8217..ed716f66e91 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php @@ -173,7 +173,7 @@ public static function analyze( $negated_left_clauses = array_values( array_filter( $negated_left_clauses, - static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses) + static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses), ), ); diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php index bf8d1af4239..6fe0bd3cf80 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php @@ -446,7 +446,7 @@ public static function analyze( $possibilities, static fn(Possibilities $assertion): bool => !(is_string($assertion->var_id) && strpos($assertion->var_id, '$this->') === 0 - ) + ), ); } $statements_analyzer->node_data->setIfTrueAssertions( @@ -469,7 +469,7 @@ public static function analyze( $possibilities, static fn(Possibilities $assertion): bool => !(is_string($assertion->var_id) && strpos($assertion->var_id, '$this->') === 0 - ) + ), ); } $statements_analyzer->node_data->setIfFalseAssertions( diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php index ceff9788724..53bbb8097bf 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php @@ -238,7 +238,7 @@ public static function analyze( if (count($possible_new_class_types) > 0) { $class_type = array_reduce( $possible_new_class_types, - static fn(?Union $type_1, Union $type_2): Union => Type::combineUnionTypes($type_1, $type_2, $codebase) + static fn(?Union $type_1, Union $type_2): Union => Type::combineUnionTypes($type_1, $type_2, $codebase), ); } diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php index 5056d25b1f9..48c50ed0c24 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php @@ -419,7 +419,7 @@ private static function handleNamedCall( $mixin_candidates_no_generic = array_filter( $mixin_candidates, - static fn(Atomic $check): bool => !($check instanceof TGenericObject) + static fn(Atomic $check): bool => !($check instanceof TGenericObject), ); // $mixin_candidates_no_generic will only be empty when there are TGenericObject entries. diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php index 7524c523baa..24133ac4d86 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php @@ -139,7 +139,7 @@ static function (Clause $c) use ($mixed_var_ids, $cond_object_id): Clause { $ternary_context_clauses = array_values( array_filter( $ternary_context_clauses, - static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses) + static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses), ), ); diff --git a/src/Psalm/Internal/Cli/LanguageServer.php b/src/Psalm/Internal/Cli/LanguageServer.php index 0fa174eff1f..99a8521f004 100644 --- a/src/Psalm/Internal/Cli/LanguageServer.php +++ b/src/Psalm/Internal/Cli/LanguageServer.php @@ -282,7 +282,7 @@ static function (string $arg) use ($valid_long_options): void { // we ignore the FQN because of a hack in scoper.inc that needs full path // phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName static fn(): ?\Composer\Autoload\ClassLoader => - CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir) + CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir), ); if (array_key_exists('v', $options)) { diff --git a/src/Psalm/Internal/Cli/Psalm.php b/src/Psalm/Internal/Cli/Psalm.php index 5aacced0f61..30b6679ecd4 100644 --- a/src/Psalm/Internal/Cli/Psalm.php +++ b/src/Psalm/Internal/Cli/Psalm.php @@ -226,7 +226,7 @@ public static function run(array $argv): void // we ignore the FQN because of a hack in scoper.inc that needs full path // phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName static fn(): ?\Composer\Autoload\ClassLoader => - CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir) + CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir), ); $run_taint_analysis = self::shouldRunTaintAnalysis($options); @@ -502,7 +502,7 @@ private static function generateConfig(string $current_dir, array &$args): void && $arg !== '--debug-emitted-issues' && strpos($arg, '--disable-extension=') !== 0 && strpos($arg, '--root=') !== 0 - && strpos($arg, '--r=') !== 0 + && strpos($arg, '--r=') !== 0, )); $init_level = null; diff --git a/src/Psalm/Internal/Cli/Psalter.php b/src/Psalm/Internal/Cli/Psalter.php index d42a1f10843..db9810ea12c 100644 --- a/src/Psalm/Internal/Cli/Psalter.php +++ b/src/Psalm/Internal/Cli/Psalter.php @@ -221,7 +221,7 @@ public static function run(array $argv): void // we ignore the FQN because of a hack in scoper.inc that needs full path // phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName static fn(): ?\Composer\Autoload\ClassLoader => - CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir) + CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir), ); $ini_handler = new PsalmRestarter('PSALTER'); $ini_handler->disableExtensions([ diff --git a/src/Psalm/Internal/Cli/Refactor.php b/src/Psalm/Internal/Cli/Refactor.php index b23bcb863c2..9ffc04d943a 100644 --- a/src/Psalm/Internal/Cli/Refactor.php +++ b/src/Psalm/Internal/Cli/Refactor.php @@ -192,7 +192,7 @@ static function (string $arg) use ($valid_long_options): void { // we ignore the FQN because of a hack in scoper.inc that needs full path // phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName static fn(): ?\Composer\Autoload\ClassLoader => - CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir) + CliUtils::requireAutoloaders($current_dir, isset($options['r']), $vendor_dir), ); // If Xdebug is enabled, restart without it diff --git a/src/Psalm/Internal/CliUtils.php b/src/Psalm/Internal/CliUtils.php index 8f0f1fbf9cb..92e7286e342 100644 --- a/src/Psalm/Internal/CliUtils.php +++ b/src/Psalm/Internal/CliUtils.php @@ -549,7 +549,7 @@ public static function checkRuntimeRequirements(): void $missing_extensions = array_filter( $required_extensions, - static fn(string $ext) => !extension_loaded($ext) + static fn(string $ext) => !extension_loaded($ext), ); if ($missing_extensions) { diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index 552fab265d5..d65853cfc3b 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -1599,7 +1599,7 @@ public function getConstantsForClass(string $class_name, int $visibility): array $storage->constants, static fn(ClassConstantStorage $constant): bool => $constant->type && ($constant->visibility === ClassLikeAnalyzer::VISIBILITY_PUBLIC - || $constant->visibility === ClassLikeAnalyzer::VISIBILITY_PROTECTED) + || $constant->visibility === ClassLikeAnalyzer::VISIBILITY_PROTECTED), ); } @@ -2410,7 +2410,7 @@ private function getConstantType( fn(ClassConstantStorage $resolved_constant) => $this->filterConstantNameByVisibility( $resolved_constant, $visibility, - ) + ), ); if ($filtered_constants_by_visibility === []) { diff --git a/src/Psalm/Internal/Fork/PsalmRestarter.php b/src/Psalm/Internal/Fork/PsalmRestarter.php index af4d83776b8..6d1dada4c3a 100644 --- a/src/Psalm/Internal/Fork/PsalmRestarter.php +++ b/src/Psalm/Internal/Fork/PsalmRestarter.php @@ -61,7 +61,7 @@ protected function requiresRestart($default): bool { $this->required = (bool) array_filter( $this->disabled_extensions, - static fn(string $extension): bool => extension_loaded($extension) + static fn(string $extension): bool => extension_loaded($extension), ); $opcache_loaded = extension_loaded('opcache') || extension_loaded('Zend OPcache'); diff --git a/src/Psalm/Internal/LanguageServer/LanguageClient.php b/src/Psalm/Internal/LanguageServer/LanguageClient.php index 4575aa3d575..d20b17ec94e 100644 --- a/src/Psalm/Internal/LanguageServer/LanguageClient.php +++ b/src/Psalm/Internal/LanguageServer/LanguageClient.php @@ -145,8 +145,6 @@ public function makeProgress(string $token): ProgressInterface /** * Configuration Refreshed from Client - * - * @param array $config */ private function configurationRefreshed(array $config): void { diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php index 14309b4349a..b0f4003c49a 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php @@ -422,7 +422,7 @@ public function start(PhpParser\Node\Stmt\ClassLike $node): ?bool usort( $docblock_info->templates, - static fn(array $l, array $r): int => $l[4] > $r[4] ? 1 : -1 + static fn(array $l, array $r): int => $l[4] > $r[4] ? 1 : -1, ); foreach ($docblock_info->templates as $i => $template_map) { diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php index cfeb0b15f30..313a3713af4 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php @@ -917,7 +917,7 @@ private static function improveParamsFromDocblock( $params_without_docblock_type = array_filter( $storage->params, - static fn(FunctionLikeParameter $p): bool => !$p->has_docblock_type && (!$p->type || $p->type->hasArray()) + static fn(FunctionLikeParameter $p): bool => !$p->has_docblock_type && (!$p->type || $p->type->hasArray()), ); if ($params_without_docblock_type) { diff --git a/src/Psalm/Internal/Provider/FileReferenceProvider.php b/src/Psalm/Internal/Provider/FileReferenceProvider.php index b89a2604128..87a77167184 100644 --- a/src/Psalm/Internal/Provider/FileReferenceProvider.php +++ b/src/Psalm/Internal/Provider/FileReferenceProvider.php @@ -180,7 +180,7 @@ public function getDeletedReferencedFiles(): array if (self::$deleted_files === null) { self::$deleted_files = array_filter( array_keys(self::$file_references), - fn(string $file_name): bool => !$this->file_provider->fileExists($file_name) + fn(string $file_name): bool => !$this->file_provider->fileExists($file_name), ); } diff --git a/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php b/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php index ada2e2825c6..d5d32ac58c8 100644 --- a/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php +++ b/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php @@ -106,7 +106,7 @@ static function ($keyed_type) use ($statements_source, $context) { }, $first_arg_array->properties, ), - static fn($keyed_type) => !$keyed_type->isNever() + static fn($keyed_type) => !$keyed_type->isNever(), ); if (!$new_properties) { diff --git a/src/Psalm/Internal/Type/TypeExpander.php b/src/Psalm/Internal/Type/TypeExpander.php index 0855a1ab732..8f7225ef37a 100644 --- a/src/Psalm/Internal/Type/TypeExpander.php +++ b/src/Psalm/Internal/Type/TypeExpander.php @@ -634,7 +634,7 @@ private static function expandNamedObject( if ($container_class_storage->template_types && array_filter( $container_class_storage->template_types, - static fn($type_map): bool => !reset($type_map)->hasMixed() + static fn($type_map): bool => !reset($type_map)->hasMixed(), ) ) { $return_type = new TGenericObject( diff --git a/src/Psalm/IssueBuffer.php b/src/Psalm/IssueBuffer.php index 33fc16bc800..45f8d53e9cf 100644 --- a/src/Psalm/IssueBuffer.php +++ b/src/Psalm/IssueBuffer.php @@ -575,7 +575,7 @@ public static function finish( $file_issues, static fn(IssueData $d1, IssueData $d2): int => [$d1->file_path, $d1->line_from, $d1->column_from] <=> - [$d2->file_path, $d2->line_from, $d2->column_from] + [$d2->file_path, $d2->line_from, $d2->column_from], ); self::$issues_data[$file_path] = $file_issues; } diff --git a/src/Psalm/Type/Atomic.php b/src/Psalm/Type/Atomic.php index 46092ec8162..ee0b4d7ca57 100644 --- a/src/Psalm/Type/Atomic.php +++ b/src/Psalm/Type/Atomic.php @@ -453,7 +453,7 @@ public function isNamedObjectType(): bool && ($this->as->hasNamedObjectType() || array_filter( $this->extra_types, - static fn($extra_type): bool => $extra_type->isNamedObjectType() + static fn($extra_type): bool => $extra_type->isNamedObjectType(), ) ) ); @@ -545,7 +545,7 @@ public function hasTraversableInterface(Codebase $codebase): bool $this->extra_types && array_filter( $this->extra_types, - static fn(Atomic $a): bool => $a->hasTraversableInterface($codebase) + static fn(Atomic $a): bool => $a->hasTraversableInterface($codebase), ) ) ); @@ -568,7 +568,7 @@ public function hasCountableInterface(Codebase $codebase): bool $this->extra_types && array_filter( $this->extra_types, - static fn(Atomic $a): bool => $a->hasCountableInterface($codebase) + static fn(Atomic $a): bool => $a->hasCountableInterface($codebase), ) ) ); @@ -606,7 +606,7 @@ public function hasArrayAccessInterface(Codebase $codebase): bool $this->extra_types && array_filter( $this->extra_types, - static fn(Atomic $a): bool => $a->hasArrayAccessInterface($codebase) + static fn(Atomic $a): bool => $a->hasArrayAccessInterface($codebase), ) ) ); diff --git a/src/Psalm/Type/UnionTrait.php b/src/Psalm/Type/UnionTrait.php index a500789cf41..b471b795df3 100644 --- a/src/Psalm/Type/UnionTrait.php +++ b/src/Psalm/Type/UnionTrait.php @@ -381,7 +381,7 @@ public function canBeFullyExpressedInPhp(int $analysis_php_version_id): bool return !array_filter( $types, - static fn($atomic_type): bool => !$atomic_type->canBeFullyExpressedInPhp($analysis_php_version_id) + static fn($atomic_type): bool => !$atomic_type->canBeFullyExpressedInPhp($analysis_php_version_id), ); } @@ -459,7 +459,7 @@ public function hasArrayAccessInterface(Codebase $codebase): bool { return (bool)array_filter( $this->types, - static fn($type): bool => $type->hasArrayAccessInterface($codebase) + static fn($type): bool => $type->hasArrayAccessInterface($codebase), ); } @@ -750,7 +750,7 @@ public function hasTemplate(): bool $type->extra_types, static fn($t): bool => $t instanceof TTemplateParam, ) - ) + ), ); } @@ -782,7 +782,7 @@ public function hasTemplateOrStatic(): bool ) ) ) - ) + ), ); } @@ -993,7 +993,7 @@ public function isInt(bool $check_templates = false): bool || ($check_templates && $type instanceof TTemplateParam && $type->as->isInt() - ) + ), ), ) === count($this->types); } @@ -1024,7 +1024,7 @@ public function isString(bool $check_templates = false): bool || ($check_templates && $type instanceof TTemplateParam && $type->as->isString() - ) + ), ), ) === count($this->types); } @@ -1043,7 +1043,7 @@ public function isNonEmptyString(bool $check_templates = false): bool || ($check_templates && $type instanceof TTemplateParam && $type->as->isNonEmptyString() - ) + ), ), ) === count($this->types); } diff --git a/tests/DocumentationTest.php b/tests/DocumentationTest.php index 74c0cb6eae6..aff06fde78b 100644 --- a/tests/DocumentationTest.php +++ b/tests/DocumentationTest.php @@ -349,7 +349,7 @@ public function testShortcodesAreUnique(): void $duplicate_shortcodes = array_filter( $all_shortcodes, - static fn($issues): bool => count($issues) > 1 + static fn($issues): bool => count($issues) > 1, ); $this->assertEquals( diff --git a/tests/LanguageServer/Message.php b/tests/LanguageServer/Message.php index 075a50a8134..2067c901d29 100644 --- a/tests/LanguageServer/Message.php +++ b/tests/LanguageServer/Message.php @@ -17,8 +17,6 @@ abstract class Message extends AdvancedJsonRpcMessage { /** * Returns the appropriate Message subclass - * - * @param array $msg */ public static function parseArray(array $msg): AdvancedJsonRpcMessage {