1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Remove redundant flag from SimpleTypeInferer

This commit is contained in:
adrew 2022-01-31 22:41:44 +03:00
parent 121a801616
commit e284b91b82
2 changed files with 3 additions and 8 deletions

View File

@ -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)) {

View File

@ -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);