From 810758792929c00d483146e3cb286c6d370443c3 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 3 Jun 2018 09:13:14 -0400 Subject: [PATCH] Always hoist constants if in config --- src/Psalm/Visitor/DependencyFinderVisitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Visitor/DependencyFinderVisitor.php b/src/Psalm/Visitor/DependencyFinderVisitor.php index fbb631f57..7d2d54d02 100644 --- a/src/Psalm/Visitor/DependencyFinderVisitor.php +++ b/src/Psalm/Visitor/DependencyFinderVisitor.php @@ -426,7 +426,7 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P ?: Type::getMixed(); $const_name = $first_arg_value->value; - if ($this->functionlike_storages) { + if ($this->functionlike_storages && !$this->config->hoist_constants) { $functionlike_storage = $this->functionlike_storages[count($this->functionlike_storages) - 1]; $functionlike_storage->defined_constants[$const_name] = $const_type;