Skip to content

Commit 8e1aa46

Browse files
committed
CS fix
- trailing commas in calls with anon functions - useless array docblock Refs slevomat/coding-standard@8d0f603 Refs slevomat/coding-standard@6ea0278
1 parent dca888c commit 8e1aa46

29 files changed

Lines changed: 39 additions & 43 deletions

src/Psalm/Internal/Analyzer/ClassAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ public static function addContextProperties(
946946
$stmts,
947947
static fn($stmt): bool => $stmt instanceof PhpParser\Node\Stmt\Property
948948
&& isset($stmt->props[0]->name->name)
949-
&& $stmt->props[0]->name->name === $property_name
949+
&& $stmt->props[0]->name->name === $property_name,
950950
);
951951

952952
$suppressed = [];

src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public static function verifyReturnType(
245245
if (count($inferred_return_type_parts) > 1) {
246246
$inferred_return_type_parts = array_filter(
247247
$inferred_return_type_parts,
248-
static fn(Union $union_type): bool => !$union_type->isNever()
248+
static fn(Union $union_type): bool => !$union_type->isNever(),
249249
);
250250
}
251251
$inferred_return_type_parts = array_values($inferred_return_type_parts);

src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static function analyze(
7878
$entry_clauses,
7979
static fn(Clause $c): bool => count($c->possibilities) > 1
8080
|| $c->wedge
81-
|| !isset($changed_var_ids[array_key_first($c->possibilities)])
81+
|| !isset($changed_var_ids[array_key_first($c->possibilities)]),
8282
),
8383
);
8484
}

src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public static function analyze(
144144
$elseif_context_clauses = array_values(
145145
array_filter(
146146
$elseif_context_clauses,
147-
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true)
147+
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true),
148148
),
149149
);
150150
}

src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static function analyze(
182182
$if_context->clauses = array_values(
183183
array_filter(
184184
$if_context->clauses,
185-
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses)
185+
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses),
186186
),
187187
);
188188

src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static function analyze(
105105
$context_clauses = array_values(
106106
array_filter(
107107
$context_clauses,
108-
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true)
108+
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses, true),
109109
),
110110
);
111111

src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public static function analyze(
173173
$negated_left_clauses = array_values(
174174
array_filter(
175175
$negated_left_clauses,
176-
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses)
176+
static fn(Clause $c): bool => !in_array($c->hash, $reconciled_expression_clauses),
177177
),
178178
);
179179

src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public static function analyze(
446446
$possibilities,
447447
static fn(Possibilities $assertion): bool => !(is_string($assertion->var_id)
448448
&& strpos($assertion->var_id, '$this->') === 0
449-
)
449+
),
450450
);
451451
}
452452
$statements_analyzer->node_data->setIfTrueAssertions(
@@ -469,7 +469,7 @@ public static function analyze(
469469
$possibilities,
470470
static fn(Possibilities $assertion): bool => !(is_string($assertion->var_id)
471471
&& strpos($assertion->var_id, '$this->') === 0
472-
)
472+
),
473473
);
474474
}
475475
$statements_analyzer->node_data->setIfFalseAssertions(

src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public static function analyze(
238238
if (count($possible_new_class_types) > 0) {
239239
$class_type = array_reduce(
240240
$possible_new_class_types,
241-
static fn(?Union $type_1, Union $type_2): Union => Type::combineUnionTypes($type_1, $type_2, $codebase)
241+
static fn(?Union $type_1, Union $type_2): Union => Type::combineUnionTypes($type_1, $type_2, $codebase),
242242
);
243243
}
244244

src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ private static function handleNamedCall(
419419

420420
$mixin_candidates_no_generic = array_filter(
421421
$mixin_candidates,
422-
static fn(Atomic $check): bool => !($check instanceof TGenericObject)
422+
static fn(Atomic $check): bool => !($check instanceof TGenericObject),
423423
);
424424

425425
// $mixin_candidates_no_generic will only be empty when there are TGenericObject entries.

0 commit comments

Comments
 (0)