1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Don’t preserve old storages when receiving worker data

This bug was found when running Psalm in threaded execution mode
This commit is contained in:
Matthew Brown 2019-01-15 23:24:29 -05:00
parent 37aef674a1
commit 90dc39c296
3 changed files with 8 additions and 8 deletions

View File

@ -107,8 +107,8 @@ class ClassLikeStorageProvider
*/
public function addMore(array $more)
{
self::$new_storage = array_merge($more, self::$new_storage);
self::$storage = array_merge($more, self::$storage);
self::$new_storage = array_merge(self::$new_storage, $more);
self::$storage = array_merge(self::$storage, $more);
}
/**

View File

@ -112,8 +112,8 @@ class FileStorageProvider
*/
public function addMore(array $more)
{
self::$new_storage = array_merge($more, self::$new_storage);
self::$storage = array_merge($more, self::$storage);
self::$new_storage = array_merge(self::$new_storage, $more);
self::$storage = array_merge(self::$storage, $more);
}
/**

View File

@ -400,7 +400,7 @@ abstract class Atomic
);
if ($file_storage) {
$file_storage->referenced_classlikes[] = $this->value;
$file_storage->referenced_classlikes[strtolower($this->value)] = $this->value;
}
}
}
@ -413,7 +413,7 @@ abstract class Atomic
!$this->from_docblock
);
if ($file_storage) {
$file_storage->referenced_classlikes[] = $this->fq_classlike_name;
$file_storage->referenced_classlikes[strtolower($this->fq_classlike_name)] = $this->fq_classlike_name;
}
}
@ -425,7 +425,7 @@ abstract class Atomic
!$this->from_docblock
);
if ($file_storage) {
$file_storage->referenced_classlikes[] = $this->as;
$file_storage->referenced_classlikes[strtolower($this->as)] = $this->as;
}
}
@ -445,7 +445,7 @@ abstract class Atomic
!$this->from_docblock
);
if ($file_storage) {
$file_storage->referenced_classlikes[] = $this->value;
$file_storage->referenced_classlikes[strtolower($this->value)] = $this->value;
}
}