Skip to content

Commit

Permalink
report invalidCasing when using a class that is not user defined too …
Browse files Browse the repository at this point in the history
…(e.g. new DateTime)
  • Loading branch information
kkmuffme committed Sep 7, 2022
1 parent cfe7fd1 commit b8138e5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,14 @@ public static function checkFullyQualifiedClassLikeName(
|| ($interface_exists && !$codebase->interfaceHasCorrectCasing($fq_class_name))
|| ($enum_exists && !$codebase->classlikes->enumHasCorrectCasing($fq_class_name))
) {
if ($codebase->classlikes->isUserDefined(strtolower($aliased_name))) {
IssueBuffer::maybeAdd(
new InvalidClass(
'Class, interface or enum ' . $fq_class_name . ' has wrong casing',
$code_location,
$fq_class_name
),
$suppressed_issues
);
}
IssueBuffer::maybeAdd(
new InvalidClass(
'Class, interface or enum ' . $fq_class_name . ' has wrong casing',
$code_location,
$fq_class_name
),
$suppressed_issues
);
}
}

Expand Down

0 comments on commit b8138e5

Please sign in to comment.