diff --git a/src/Psalm/Internal/Type/AssertionReconciler.php b/src/Psalm/Internal/Type/AssertionReconciler.php index cf0426a6a..bb7e71ffa 100644 --- a/src/Psalm/Internal/Type/AssertionReconciler.php +++ b/src/Psalm/Internal/Type/AssertionReconciler.php @@ -340,9 +340,11 @@ class AssertionReconciler extends Reconciler } if ($acceptable_atomic_types) { - $acceptable_atomic_types = count($acceptable_atomic_types) === count($existing_var_type->getAtomicTypes()) - ? $existing_var_type - : new Union($acceptable_atomic_types); + $acceptable_atomic_types = + count($acceptable_atomic_types) === count($existing_var_type->getAtomicTypes()) + ? $existing_var_type + : new Union($acceptable_atomic_types) + ; return new Union([$new_type_part->replaceAs($acceptable_atomic_types)]); } } diff --git a/src/Psalm/Internal/Type/TypeCombiner.php b/src/Psalm/Internal/Type/TypeCombiner.php index 9a537fac4..c139314cf 100644 --- a/src/Psalm/Internal/Type/TypeCombiner.php +++ b/src/Psalm/Internal/Type/TypeCombiner.php @@ -252,7 +252,13 @@ class TypeCombiner if ($generic_type === 'iterable') { $new_types[] = new TIterable($generic_type_params); } else { - $generic_object = new TGenericObject($generic_type, $generic_type_params, false, false, $combination->extra_types); + $generic_object = new TGenericObject( + $generic_type, + $generic_type_params, + false, + false, + $combination->extra_types + ); $new_types[] = $generic_object; if ($combination->named_object_types) { diff --git a/src/Psalm/Internal/Type/TypeExpander.php b/src/Psalm/Internal/Type/TypeExpander.php index dea987982..655bfa745 100644 --- a/src/Psalm/Internal/Type/TypeExpander.php +++ b/src/Psalm/Internal/Type/TypeExpander.php @@ -243,7 +243,10 @@ class TypeExpander $return_type = $return_type->replaceClassLike('self', $self_class); } if (is_string($static_class_type) || $self_class) { - $return_type = $return_type->replaceClassLike('static', is_string($static_class_type) ? $static_class_type : $self_class); + $return_type = $return_type->replaceClassLike( + 'static', + is_string($static_class_type) ? $static_class_type : $self_class + ); } if ($evaluate_class_constants && $codebase->classOrInterfaceOrEnumExists($return_type->fq_classlike_name)) {