From f21390d7ceec86414b483df670cca3ea29a7a0b7 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 25 Jul 2023 11:11:47 +0200 Subject: [PATCH] Remove extremely strange logic --- src/Psalm/Internal/Codebase/ClassLikes.php | 24 +++------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index 32cc09de2..2ae62e664 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -366,13 +366,7 @@ class ClassLikes ) && !$this->classlike_storage_provider->has($fq_class_name_lc) ) { - if (!isset($this->existing_classes_lc[$fq_class_name_lc])) { - $this->existing_classes_lc[$fq_class_name_lc] = false; - - return false; - } - - return $this->existing_classes_lc[$fq_class_name_lc]; + return $this->existing_classes_lc[$fq_class_name_lc] = false; } return false; @@ -406,13 +400,7 @@ class ClassLikes ) && !$this->classlike_storage_provider->has($fq_class_name_lc) ) { - if (!isset($this->existing_interfaces_lc[$fq_class_name_lc])) { - $this->existing_interfaces_lc[$fq_class_name_lc] = false; - - return false; - } - - return $this->existing_interfaces_lc[$fq_class_name_lc]; + return $this->existing_interfaces_lc[$fq_class_name_lc] = false; } return false; @@ -473,13 +461,7 @@ class ClassLikes ) && !$this->classlike_storage_provider->has($fq_class_name_lc) ) { - if (!isset($this->existing_enums_lc[$fq_class_name_lc])) { - $this->existing_enums_lc[$fq_class_name_lc] = false; - - return false; - } - - return $this->existing_enums_lc[$fq_class_name_lc]; + return $this->existing_enums_lc[$fq_class_name_lc] = false; } return false;