Skip to content

Commit

Permalink
Remove redundant flag from SimpleTypeInferer
Browse files Browse the repository at this point in the history
  • Loading branch information
klimick committed Jan 31, 2022
1 parent 121a801 commit e284b91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public static function infer(
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) {
Expand Down Expand Up @@ -432,7 +431,7 @@ public static function infer(
}
}

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)) {
Expand Down
6 changes: 1 addition & 5 deletions src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,7 @@ public function enterNode(PhpParser\Node $node): ?int
$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);
Expand Down

0 comments on commit e284b91

Please sign in to comment.