1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-08 14:08:43 +01:00
This commit is contained in:
Daniil Gentili 2023-07-25 11:52:50 +02:00
parent f21390d7ce
commit 5e77f1b9e2
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -356,22 +356,12 @@ class ClassLikes
} }
} }
if (!isset($this->existing_classes_lc[$fq_class_name_lc]) if (isset($this->existing_classes_lc[$fq_class_name_lc])) {
|| !$this->existing_classes_lc[$fq_class_name_lc] return $this->existing_classes_lc[$fq_class_name_lc];
|| !$this->classlike_storage_provider->has($fq_class_name_lc) } elseif (!$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]
)
&& !$this->classlike_storage_provider->has($fq_class_name_lc)
) {
return $this->existing_classes_lc[$fq_class_name_lc] = false; return $this->existing_classes_lc[$fq_class_name_lc] = false;
} }
return false;
}
if ($this->collect_locations && $code_location) { if ($this->collect_locations && $code_location) {
$this->file_reference_provider->addCallingLocationForClass( $this->file_reference_provider->addCallingLocationForClass(
$code_location, $code_location,
@ -379,7 +369,7 @@ class ClassLikes
); );
} }
return true; return $this->existing_classes_lc[$fq_class_name_lc] = true;
} }
public function hasFullyQualifiedInterfaceName( public function hasFullyQualifiedInterfaceName(
@ -390,22 +380,12 @@ class ClassLikes
): bool { ): bool {
$fq_class_name_lc = strtolower($this->getUnAliasedName($fq_class_name)); $fq_class_name_lc = strtolower($this->getUnAliasedName($fq_class_name));
if (!isset($this->existing_interfaces_lc[$fq_class_name_lc]) if (isset($this->existing_interfaces_lc[$fq_class_name_lc])) {
|| !$this->existing_interfaces_lc[$fq_class_name_lc] return $this->existing_interfaces_lc[$fq_class_name_lc];
|| !$this->classlike_storage_provider->has($fq_class_name_lc) } elseif (!$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]
)
&& !$this->classlike_storage_provider->has($fq_class_name_lc)
) {
return $this->existing_interfaces_lc[$fq_class_name_lc] = false; return $this->existing_interfaces_lc[$fq_class_name_lc] = false;
} }
return false;
}
if ($this->collect_references && $code_location) { if ($this->collect_references && $code_location) {
if ($calling_method_id) { if ($calling_method_id) {
$this->file_reference_provider->addMethodReferenceToClass( $this->file_reference_provider->addMethodReferenceToClass(
@ -440,7 +420,7 @@ class ClassLikes
); );
} }
return true; return $this->existing_interfaces_lc[$fq_class_name_lc] = true;
} }
public function hasFullyQualifiedEnumName( public function hasFullyQualifiedEnumName(
@ -451,22 +431,12 @@ class ClassLikes
): bool { ): bool {
$fq_class_name_lc = strtolower($this->getUnAliasedName($fq_class_name)); $fq_class_name_lc = strtolower($this->getUnAliasedName($fq_class_name));
if (!isset($this->existing_enums_lc[$fq_class_name_lc]) if (isset($this->existing_enums_lc[$fq_class_name_lc])) {
|| !$this->existing_enums_lc[$fq_class_name_lc] return $this->existing_enums_lc[$fq_class_name_lc];
|| !$this->classlike_storage_provider->has($fq_class_name_lc) } elseif (!$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]
)
&& !$this->classlike_storage_provider->has($fq_class_name_lc)
) {
return $this->existing_enums_lc[$fq_class_name_lc] = false; return $this->existing_enums_lc[$fq_class_name_lc] = false;
} }
return false;
}
if ($this->collect_references && $code_location) { if ($this->collect_references && $code_location) {
if ($calling_method_id) { if ($calling_method_id) {
$this->file_reference_provider->addMethodReferenceToClass( $this->file_reference_provider->addMethodReferenceToClass(
@ -501,7 +471,7 @@ class ClassLikes
); );
} }
return true; return $this->existing_enums_lc[$fq_class_name_lc] = true;
} }
public function hasFullyQualifiedTraitName(string $fq_class_name, ?CodeLocation $code_location = null): bool public function hasFullyQualifiedTraitName(string $fq_class_name, ?CodeLocation $code_location = null): bool