diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php index a22a85846..6462c6d1c 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php @@ -55,8 +55,7 @@ class SimpleTypeInferer Aliases $aliases, FileSource $file_source = null, ?array $existing_class_constants = null, - ?string $fq_classlike_name = null, - bool $const_inference = false + ?string $fq_classlike_name = null ): ?Union { if ($stmt instanceof PhpParser\Node\Expr\BinaryOp) { if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\Concat) { @@ -432,7 +431,7 @@ class SimpleTypeInferer } } - if ($const_inference && $stmt instanceof PhpParser\Node\Expr\New_) { + if ($stmt instanceof PhpParser\Node\Expr\New_) { $resolved_class_name = $stmt->class->getAttribute('resolvedName'); if (!is_string($resolved_class_name)) { diff --git a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php index 95a6e983a..e99259cfc 100644 --- a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php @@ -287,11 +287,7 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements FileSour $this->codebase, new NodeDataProvider(), $const->value, - $this->aliases, - null, - null, - null, - true + $this->aliases ) ?? Type::getMixed(); $fq_const_name = Type::getFQCLNFromString($const->name->name, $this->aliases);