diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php index 349eaf5ff..c00803dd1 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php @@ -23,7 +23,7 @@ use Psalm\Type\Reconciler; use function array_diff_key; use function array_filter; -use function array_keys; +use function array_key_first; use function array_merge; use function array_values; use function count; @@ -80,7 +80,7 @@ final class IfConditionalAnalyzer $entry_clauses, static fn(Clause $c): bool => count($c->possibilities) > 1 || $c->wedge - || !isset($changed_var_ids[array_keys($c->possibilities)[0]]) + || !isset($changed_var_ids[array_key_first($c->possibilities)]) ), ); } diff --git a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php index c8bd3c1b2..ed40b0701 100644 --- a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php +++ b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php @@ -2982,7 +2982,7 @@ final class SimpleAssertionReconciler extends Reconciler continue; } - $enum_case = $class_storage->enum_cases[$atomic_type->const_name] ?? null; + $enum_case = $class_storage->enum_cases[$enum_case_to_assert] ?? null; if ($enum_case === null) { return null; }