We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b250db commit 29fd095Copy full SHA for 29fd095
src/Rules/Cast/InvalidCastRule.php
@@ -83,14 +83,11 @@ static function (Type $type) use ($castTypeCallback): bool {
83
if ($castType instanceof ErrorType) {
84
$classReflection = $this->reflectionProvider->getClass(get_class($node));
85
$shortName = $classReflection->getNativeReflection()->getShortName();
86
- if ($shortName === '') {
87
- throw new ShouldNotHappenException();
88
- }
89
90
$shortName = strtolower($shortName);
91
if ($shortName === 'double') {
92
$shortName = 'float';
93
- } else {
+ } elseif ($shortName !== '') {
94
$shortName = substr($shortName, 0, -1);
95
}
96
0 commit comments