Skip to content

Commit 29fd095

Browse files
committed
try different fix
1 parent 7b250db commit 29fd095

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Rules/Cast/InvalidCastRule.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,11 @@ static function (Type $type) use ($castTypeCallback): bool {
8383
if ($castType instanceof ErrorType) {
8484
$classReflection = $this->reflectionProvider->getClass(get_class($node));
8585
$shortName = $classReflection->getNativeReflection()->getShortName();
86-
if ($shortName === '') {
87-
throw new ShouldNotHappenException();
88-
}
8986

9087
$shortName = strtolower($shortName);
9188
if ($shortName === 'double') {
9289
$shortName = 'float';
93-
} else {
90+
} elseif ($shortName !== '') {
9491
$shortName = substr($shortName, 0, -1);
9592
}
9693

0 commit comments

Comments
 (0)