diff --git a/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php b/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php index 250bc7d64..e6d4680d4 100644 --- a/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php +++ b/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php @@ -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); } /** diff --git a/src/Psalm/Internal/Provider/FileStorageProvider.php b/src/Psalm/Internal/Provider/FileStorageProvider.php index 2af3e85c2..e15177c9e 100644 --- a/src/Psalm/Internal/Provider/FileStorageProvider.php +++ b/src/Psalm/Internal/Provider/FileStorageProvider.php @@ -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); } /** diff --git a/src/Psalm/Type/Atomic.php b/src/Psalm/Type/Atomic.php index 16aad341a..bbc4068cb 100644 --- a/src/Psalm/Type/Atomic.php +++ b/src/Psalm/Type/Atomic.php @@ -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; } }