1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Always hoist constants if in config

This commit is contained in:
Matthew Brown 2018-06-03 09:13:14 -04:00
parent 033bf3db16
commit 8107587929

View File

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